Looks like you missed one change in the docs:
try:
article.full_validate()
except ValidationError, e:
# Do something based on the errors contained in e.error_dict.
# Display them to a user, or handle them programatically.
Appears in
http://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects
I opened a ticket at http://code.djangoproject.com/ticket/12586
Johann
Joseph Kocherhans wrote:
I just committed r12206 [1] which contains a few
backwards-incompatible changes to model validation. First off,
ModelForm used to validate your entire model and raise
UnresolvableValidationError for any model fields that had errors, but
were excluded from the form. Now, ModelForm will only validate the
fields present on the form. This should mimic the pre-merge behavior.
Also, to be more consistent with forms, model.full_validate() was
renamed to model.full_clean() and model.validate() was renamed to
model.clean(). You'll have to rename those methods and calls if you've
already started using them.
model.clean() is still called as part of ModelForm validation, but it
now does nothing by default. It used to call model.validate_unique(),
but that call has been moved up to the model.full_clean() method. This
means that you can still start using at least part of model validation
without having to tell your ModelForm about it, or alter your views.
Sorry for the problems, folks.
Thanks,
Joseph
[1] http://code.djangoproject.com/changeset/12206
--
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en.