Ticket #4752: div-form.diff
File div-form.diff, 1.2 KB (added by , 17 years ago) |
---|
-
django/newforms/forms.py
110 110 """ 111 111 return self.prefix and ('%s-%s' % (self.prefix, field_name)) or field_name 112 112 113 def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row ):113 def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row, error_list_class = ErrorList): 114 114 "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." 115 115 top_errors = self.non_field_errors() # Errors that should be displayed above all fields. 116 116 output, hidden_fields = [], [] 117 117 for name, field in self.fields.items(): 118 118 bf = BoundField(self, field, name) 119 bf_errors = ErrorList([escape(error) for error in bf.errors]) # Escape and cache in local variable.119 bf_errors = error_list_class([escape(error) for error in bf.errors]) # Escape and cache in local variable. 120 120 if bf.is_hidden: 121 121 if bf_errors: 122 122 top_errors.extend(['(Hidden field %s) %s' % (name, e) for e in bf_errors])