#29153: Ease customizing the label attrs on a model form field
------------------------------+--------------------------------------
Reporter: ChristophRob | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: 2.0
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
------------------------------+--------------------------------------
Comment (by ChristophRob):
Replying to [comment:3 Tim Graham]:
> Thanks for the clarifying edits. I guess you're running into the problem
described on [https://stackoverflow.com/questions/6959178/how-to-set-css-
class-of-a-label-in-a-django-form-declaration Stack Overflow].
>
> I'm not sure if the use case is common enough to add a field attribute
for this. Usually I style labels using CSS3 selectors. If you can get
consensus on a proposal on the DevelopersMailingList, we can reopen the
ticket. Generally, the consensus has been that if you need to make much
customization to form rendering, you should iterate over the fields rather
than using `{{ form }}`.
Thank you Tim, for your response. Yes indeed, thats exactly my problem. As
i am using bootstrap 3 it is necessary, to set a "control-label" class to
the label. Especially for errors in form validation. It seems to me that
in bootstrap 4, the team just gave up, and does not design labels with
form errors anymore by default. So i am also gonna change to bootstrap 4,
and sadly no label error design. So i think you are right, to not fix
this.
Still it makes me wonder that the customizable label_tag is already half
implemented.
--
Ticket URL: <https://code.djangoproject.com/ticket/29153#comment:4>
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/070.7ab42e015d9f0bd453c968ed58a64e53%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.