From 5e83b79d260598fcdcc2014f99e6669c5b2a44f7 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 9 Jan 2010 22:51:03 +0000 Subject: Fixed #12466 - Set HTML class attributes for each field separately. Thanks for the patch, Bernd Schlapsi. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12153 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/forms.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/regressiontests/forms') diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py index 5f9f5dec5d..f9498c41e2 100644 --- a/tests/regressiontests/forms/forms.py +++ b/tests/regressiontests/forms/forms.py @@ -1816,6 +1816,12 @@ True # The error_html_class and required_html_class attributes #################### +>>> class Person(Form): +... name = CharField() +... is_cool = NullBooleanField() +... email = EmailField(required=False) +... age = IntegerField() + >>> p = Person({}) >>> p.error_css_class = 'error' >>> p.required_css_class = 'required' @@ -1827,6 +1833,8 @@ True +
  • +
  • >>> print p.as_p() @@ -1836,6 +1844,9 @@ True

    +

    + +

    >>> print p.as_table() @@ -1844,6 +1855,8 @@ True + + -- cgit v1.3