Ticket #17922: base_form_label_class_attr.diff
File base_form_label_class_attr.diff, 636 bytes (added by , 13 years ago) |
---|
-
django/forms/forms.py
165 165 if self.label_suffix: 166 166 if label[-1] not in ':?.!': 167 167 label += self.label_suffix 168 label = bf.label_tag(label) or '' 168 label_class_attr = {'class': 'required'} if bf.field.required else None 169 label = bf.label_tag(label, label_class_attr) or '' 169 170 else: 170 171 label = '' 171 172