Made some PEP8 fixes in docs/ref/forms/widgets.txt
Thanks Siecje.
This commit is contained in:
parent
6e0f1bc06d
commit
867f8fd6c7
|
@ -148,11 +148,9 @@ the 'type' attribute to take advantage of the new HTML5 input types. To do
|
||||||
this, you use the :attr:`Widget.attrs` argument when creating the widget::
|
this, you use the :attr:`Widget.attrs` argument when creating the widget::
|
||||||
|
|
||||||
class CommentForm(forms.Form):
|
class CommentForm(forms.Form):
|
||||||
name = forms.CharField(
|
name = forms.CharField(widget=forms.TextInput(attrs={'class': 'special'}))
|
||||||
widget=forms.TextInput(attrs={'class':'special'}))
|
|
||||||
url = forms.URLField()
|
url = forms.URLField()
|
||||||
comment = forms.CharField(
|
comment = forms.CharField(widget=forms.TextInput(attrs={'size': '40'}))
|
||||||
widget=forms.TextInput(attrs={'size':'40'}))
|
|
||||||
|
|
||||||
Django will then include the extra attributes in the rendered output:
|
Django will then include the extra attributes in the rendered output:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue