web/views/forms.py
changeset 8695 358d8bed9626
parent 8694 d901c36bcfce
child 8748 f5027f8d2478
equal deleted inserted replaced
8694:d901c36bcfce 8695:358d8bed9626
   291             processed = {}
   291             processed = {}
   292             for field in self.iter_modified_fields():
   292             for field in self.iter_modified_fields():
   293                 try:
   293                 try:
   294                     for field, value in field.process_posted(self):
   294                     for field, value in field.process_posted(self):
   295                         processed[field.role_name()] = value
   295                         processed[field.role_name()] = value
   296                 except ProcessFormError, exc:
   296                 except ProcessFormError as exc:
   297                     errors.append((field, exc))
   297                     errors.append((field, exc))
   298             if errors:
   298             if errors:
   299                 errors = dict((f.role_name(), unicode(ex)) for f, ex in errors)
   299                 errors = dict((f.role_name(), unicode(ex)) for f, ex in errors)
   300                 raise ValidationError(None, errors)
   300                 raise ValidationError(None, errors)
   301             return processed
   301             return processed