From 6d36d97cb8d0c982d7481e7d439c9848ded46a77 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 27 Nov 2006 04:23:20 +0000 Subject: [PATCH] newforms: Added BoundField.label, which calculates the label of the field based on its name git-svn-id: http://code.djangoproject.com/svn/django/trunk@4118 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/forms.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/django/newforms/forms.py b/django/newforms/forms.py index bf05e38fc2..a07df84e54 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -81,7 +81,7 @@ class Form(object): bf = BoundField(self, field, name) if bf.errors: output.append(u'' % u'\n'.join([u'
  • %s
  • ' % e for e in bf.errors])) - output.append(u'%s:%s' % (pretty_name(name), bf)) + output.append(u'%s:%s' % (bf.label, bf)) return u'\n'.join(output) def as_ul(self): @@ -95,7 +95,7 @@ class Form(object): line = u'
  • ' if bf.errors: line += u'' % u'\n'.join([u'
  • %s
  • ' % e for e in bf.errors]) - line += u'%s: %s' % (pretty_name(name), bf) + line += u'%s: %s' % (bf.label, bf) output.append(line) return u'\n'.join(output) @@ -180,6 +180,10 @@ class BoundField(object): "Returns a string of HTML for representing this as a