diff --git a/django/newforms/forms.py b/django/newforms/forms.py index ae836ba779..4fffde3b7e 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -3,6 +3,7 @@ Form classes """ from django.utils.datastructures import SortedDict +from django.utils.html import escape from fields import Field from widgets import TextInput, Textarea from util import ErrorDict, ErrorList, ValidationError @@ -81,7 +82,7 @@ class Form(object): bf = BoundField(self, field, name) if bf.errors: output.append(u'%s' % bf.errors) - output.append(u'%s:%s' % (bf.label, bf)) + output.append(u'%s%s' % (bf.label_tag(bf.verbose_name+':'), bf)) return u'\n'.join(output) def as_ul(self): @@ -95,7 +96,7 @@ class Form(object): line = u'
  • ' if bf.errors: line += str(bf.errors) - line += u'%s: %s
  • ' % (bf.label, bf) + line += u'%s %s' % (bf.label_tag(bf.verbose_name+':'), bf) output.append(line) return u'\n'.join(output) @@ -190,9 +191,21 @@ class BoundField(object): "Returns a string of HTML for representing this as a