Ticket #6043: newforms_forms.py.diff
File newforms_forms.py.diff, 1.5 KB (added by , 17 years ago) |
---|
-
django/newforms/forms.py
131 131 help_text = help_text_html % force_unicode(field.help_text) 132 132 else: 133 133 help_text = u'' 134 output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text })134 output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, 'required': field.required and '<span class="required"> * </span>' or ''}) 135 135 if top_errors: 136 136 output.insert(0, error_row % top_errors) 137 137 if hidden_fields: # Insert any hidden fields in the last row. … … 149 149 150 150 def as_table(self): 151 151 "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." 152 return self._html_output(u'<tr><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s </td></tr>', u'<tr><td colspan="2">%s</td></tr>', '</td></tr>', u'<br />%s', False)152 return self._html_output(u'<tr><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s%(required)s</td></tr>', u'<tr><td colspan="2">%s</td></tr>', '</td></tr>', u'<br />%s', False) 153 153 154 154 def as_ul(self): 155 155 "Returns this form rendered as HTML <li>s -- excluding the <ul></ul>."