From a154d94e456af97a05a6d630bd8ec7193d67684b Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 20 Jan 2007 20:31:17 +0000 Subject: [PATCH] newforms: Added attrs optional argument to BoundForm.label_tag() git-svn-id: http://code.djangoproject.com/svn/django/trunk@4369 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/forms.py | 9 ++++++--- tests/regressiontests/forms/tests.py | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/django/newforms/forms.py b/django/newforms/forms.py index 0b4687bcf3..5964c9cc5e 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -5,7 +5,7 @@ Form classes from django.utils.datastructures import SortedDict, MultiValueDict from django.utils.html import escape from fields import Field -from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput +from widgets import flatatt, TextInput, Textarea, HiddenInput, MultipleHiddenInput from util import StrAndUnicode, ErrorDict, ErrorList, ValidationError __all__ = ('BaseForm', 'Form') @@ -247,17 +247,20 @@ class BoundField(StrAndUnicode): return self.field.widget.value_from_datadict(self.form.data, self.html_name) data = property(_data) - def label_tag(self, contents=None): + def label_tag(self, contents=None, attrs=None): """ Wraps the given contents in a