#6845: Model validation and its propagation to ModelForms
---------------------------------+------------------------------------------
Reporter: Honza_Kral | Owner: nobody
Status: new | Milestone: post-1.0
Component: Forms | Version: SVN
Resolution: | Keywords: newforms validation model
modelform ep2008
Stage: Accepted | Has_patch: 1
Needs_docs: 1 | Needs_tests: 1
Needs_better_patch: 1 |
---------------------------------+------------------------------------------
Comment (by Honza_Kral):
Another version of the patch.
Implemented:
* moved ValidationError to django.core.exceptions, leaving ErrorList in
django.forms
* field.validate and field.clean on db fields
* model.clean and model.validate on models
* moved validate_unique to models
* have formsets call form.save instead of save_instance (split
save_instance into two functions for that purpose)
Not yet implemented:
* validators and their use in both db and form fields
* custom error messages (being able to override the messages from models
in forms etc.)
Broken:
* save_as_new on formsets - the model without the FK doesn't validate
well, I don't know what to do with this one - on one hand it shouldn't
validate (the model IS invalid), on the otherhand it's useful feature.
Maybe when I get around to enable turning model validation off for a form
instance, that might help a bit. Or some sort of delayed validation.
suggestions welcome.
Changed and untested:
* BaseGenericInlineFormSet
stay tuned for more.
--
Ticket URL: <http://code.djangoproject.com/ticket/6845#comment:43>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---