Author: Alex
Date: 2012-01-19 14:05:47 -0800 (Thu, 19 Jan 2012)
New Revision: 17381
Modified:
django/trunk/django/forms/forms.py
Log:
Clean up the form's code a little bit, to make it more consistantly go through
one code path. Patch from Travis Swicegood.
Modified: django/trunk/django/forms/forms.py
===================================================================
--- django/trunk/django/forms/forms.py 2012-01-19 17:39:59 UTC (rev 17380)
+++ django/trunk/django/forms/forms.py 2012-01-19 22:05:47 UTC (rev 17381)
@@ -98,8 +98,8 @@
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 @@
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:
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.