#9486 closed (duplicate)
The goal is to make sure the required field's lable be bold — at Version 3
Reported by: | tangc | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Here is the svn diff
Index: django/forms/forms.py =================================================================== --- django/forms/forms.py (revision 9084) +++ django/forms/forms.py (working copy) @@ -155,7 +155,13 @@ if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix - label = bf.label_tag(label) or '' + + attrs = None + if bf.field.required: + attrs = {'class': 'required'} + + label = bf.label_tag(label, attrs) or '' + else: label = '' if field.help_text:
Change History (4)
by , 16 years ago
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Description: | modified (diff) |
---|
(Edited description because, due to a Trac bug, it was messing up the formatting of the rest of the page.)
Note:
See TracTickets
for help on using tickets.
Hmm, I think you should check for form errors in the template and then style your label accordingly. IMHO this shouldn't be put into trunk simply because it forces a certain style onto the Django user.
What if he/she want his/her label to be a Pony when a field is required?
About your patch:
It hasn't got tests, check the contributing guidelines in the docs.