Browse files

Clean up the form's code a little bit, to make it more consistantly g…

…o through one code path. Patch from Travis Swicegood.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
alex committed Jan 19, 2012
1 parent e8e4293 commit 477f4d80616392bbd3352cad50faedb9c1494b33
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/forms/
@@ -98,8 +98,8 @@ def __unicode__(self):
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 @@ def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_
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:

0 comments on commit 477f4d8

Please sign in to comment.