mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user