With formsets, as ids contain an index number, you cannot use the same
strategy. To add some class to some field widget, you have to customize
the formset form to add a custom widget to be able to specify an
`attrs={'class': 'special'})` parameter, which is much boilerplate code
for a very common and simple addition.
I would suggest to automatically add `class="fieldname"` on each formset
widget.
--
Ticket URL: <https://code.djangoproject.com/ticket/28733>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
I think a fairly strong justification is needed given the possibility that
some unwanted CSS rules in a developer's stylesheet might start appearing
on form fields. Did you consider using a CSS rule like
`input[id$="-field_name"]`?
--
Ticket URL: <https://code.djangoproject.com/ticket/28733#comment:1>
* status: new => closed
* resolution: => wontfix
Comment:
Ah thanks, awesome CSS3 selectors! Sorry for the noise.
--
Ticket URL: <https://code.djangoproject.com/ticket/28733#comment:2>