From 55e23d5efaa11b7385c9c0d117378b07cdeb7341 Mon Sep 17 00:00:00 2001 From: Honza Král Date: Mon, 1 Jun 2009 15:38:11 +0000 Subject: [soc2009/model-validation] Moved ValidationError to django.core.exceptions and removed ErrorList from within the Error git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10867 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'django/forms/forms.py') diff --git a/django/forms/forms.py b/django/forms/forms.py index 1b9faa7e4d..6b6f1c5971 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -4,6 +4,7 @@ Form classes from copy import deepcopy +from django.core.exceptions import ValidationError from django.utils.datastructures import SortedDict from django.utils.html import conditional_escape from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode @@ -11,7 +12,7 @@ from django.utils.safestring import mark_safe from fields import Field, FileField from widgets import Media, media_property, TextInput, Textarea -from util import flatatt, ErrorDict, ErrorList, ValidationError +from util import flatatt, ErrorDict, ErrorList __all__ = ('BaseForm', 'Form') @@ -243,13 +244,13 @@ class BaseForm(StrAndUnicode): value = getattr(self, 'clean_%s' % name)() self.cleaned_data[name] = value except ValidationError, e: - self._errors[name] = e.messages + self._errors[name] = self.error_class(e.messages) if name in self.cleaned_data: del self.cleaned_data[name] try: self.cleaned_data = self.clean() except ValidationError, e: - self._errors[NON_FIELD_ERRORS] = e.messages + self._errors[NON_FIELD_ERRORS] = self.error_class(e.messages) if self._errors: delattr(self, 'cleaned_data') -- cgit v1.3