[Django] #28733: Formsets are missing classes to be easily styleable

3 views
Skip to first unread message

Django

unread,
Oct 23, 2017, 3:53:36 AM10/23/17
to django-...@googlegroups.com
#28733: Formsets are missing classes to be easily styleable
----------------------------------------+------------------------
Reporter: Claude Paroz | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
With normal forms, it's easy to style widgets with CSS thanks to unique
input ids (`input#id_field_name` selector).

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.

Django

unread,
Oct 23, 2017, 1:18:43 PM10/23/17
to django-...@googlegroups.com
#28733: Formsets are missing classes to be easily styleable
------------------------------+--------------------------------------

Reporter: Claude Paroz | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------

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>

Django

unread,
Oct 23, 2017, 2:28:15 PM10/23/17
to django-...@googlegroups.com
#28733: Formsets are missing classes to be easily styleable
------------------------------+--------------------------------------

Reporter: Claude Paroz | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Claude Paroz):

* 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>

Reply all
Reply to author
Forward
0 new messages