Ticket #17922: base_form_label_class_attr.diff

File base_form_label_class_attr.diff, 636 bytes (added by Haisheng HU, 7 years ago)

patch file for 1.3.1

  • django/forms/forms.py

     
    165165                    if self.label_suffix:
    166166                        if label[-1] not in ':?.!':
    167167                            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 ''
    169170                else:
    170171                    label = ''
    171172
Back to Top