Ticket #9486: 9486.diff

File 9486.diff, 729 bytes (added by tangc, 15 years ago)
  • django/forms/forms.py

     
    155155                    if self.label_suffix:
    156156                        if label[-1] not in ':?.!':
    157157                            label += self.label_suffix
    158                     label = bf.label_tag(label) or ''
     158
     159                    attrs = None
     160                    if bf.field.required:
     161                        attrs = {'class': 'required'}
     162                       
     163                    label = bf.label_tag(label, attrs) or ''
     164
    159165                else:
    160166                    label = ''
    161167                if field.help_text:
Back to Top