Commit 477f4d80 authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Clean up the form's code a little bit, to make it more consistantly go through...

Clean up the form's code a little bit, to make it more consistantly go through one code path. Patch from Travis Swicegood.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17381 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent e8e4293a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -98,8 +98,8 @@ class BaseForm(StrAndUnicode):
        return self.as_table()

    def __iter__(self):
        for name, field in self.fields.items():
            yield BoundField(self, field, name)
        for name in self.fields:
            yield self[name]

    def __getitem__(self, name):
        "Returns a BoundField with the given name."
@@ -145,7 +145,7 @@ class BaseForm(StrAndUnicode):

        for name, field in self.fields.items():
            html_class_attr = ''
            bf = BoundField(self, field, name)
            bf = self[name]
            bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable.
            if bf.is_hidden:
                if bf_errors: