diff options
Diffstat (limited to 'django/forms/forms.py')
-rw-r--r-- | django/forms/forms.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py index b3718efa9a..dc0800b436 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -35,7 +35,7 @@ def get_declared_fields(bases, attrs, with_base_fields=True): Also integrates any additional media definitions """ fields = [(field_name, attrs.pop(field_name)) for field_name, obj in attrs.items() if isinstance(obj, Field)] - fields.sort(lambda x, y: cmp(x[1].creation_counter, y[1].creation_counter)) + fields.sort(key=lambda x: x[1].creation_counter) # If this class is subclassing another Form, add that Form's fields. # Note that we loop over the bases in *reverse*. This is necessary in @@ -213,7 +213,7 @@ class BaseForm(StrAndUnicode): normal_row = u'<tr%(html_class_attr)s><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>', error_row = u'<tr><td colspan="2">%s</td></tr>', row_ender = u'</td></tr>', - help_text_html = u'<br />%s', + help_text_html = u'<br /><span class="helptext">%s</span>', errors_on_separate_row = False) def as_ul(self): @@ -222,7 +222,7 @@ class BaseForm(StrAndUnicode): normal_row = u'<li%(html_class_attr)s>%(errors)s%(label)s %(field)s%(help_text)s</li>', error_row = u'<li>%s</li>', row_ender = '</li>', - help_text_html = u' %s', + help_text_html = u' <span class="helptext">%s</span>', errors_on_separate_row = False) def as_p(self): @@ -231,7 +231,7 @@ class BaseForm(StrAndUnicode): normal_row = u'<p%(html_class_attr)s>%(label)s %(field)s%(help_text)s</p>', error_row = u'%s', row_ender = '</p>', - help_text_html = u' %s', + help_text_html = u' <span class="helptext">%s</span>', errors_on_separate_row = True) def non_field_errors(self): |