#29468: Form Field declaration:
-------------------------------------+-------------------------------------
Reporter: Ivan | Owner: nobody
Muller |
Type: | Status: new
Cleanup/optimization |
Component: Forms | Version: master
Severity: Normal | Keywords: Field Widget html
Triage Stage: | attrs
Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hi guys, I want to improve the way of declaring html attrs into a
Fields With out declaring the default widget again.
{{{
example:
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
full_name = forms.CharField(widget=forms.TextInput(attrs={'class':
Anyclass',}))
}}}
As Field documentaiton say into the init:
"""Each Field has a default Widget that it'll use if you don't specify
this. n most cases, the default widget is TextInput:"""
Woudl be god to declare it as
{{{
full_name = forms.CharField(widget_attrs={'class': Anyclass',})
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29468>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.c1946e7dcef924d5d442941f51d026da%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.