#6845: Model validation and its propagation to ModelForms
--------------------------------------+-------------------------------------
Reporter: Honza_Kral | Owner: nobody
Status: new | Milestone: 1.0 beta
Component: django.newforms | Version: SVN
Resolution: | Keywords: newforms validation
model modelform ep2008
Stage: Accepted | Has_patch: 1
Needs_docs: 1 | Needs_tests: 1
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Comment (by mtredinnick):
We probably do need to find a way to let the "normalise + validate" pass
change the data, Honza. This is possible now and quite a useful feature
(particularly in `Form.clean()`. It's not entirely clear where the natural
responsibility lies in the`to_python` and `validate` split, since you kind
of want to validate before munging. We should think about this. It might a
"phase 2" feature if it becomes clear that there is a solution but we bump
the implementation a bit, but I'd like to be sure there is a way to do
this.
Example use cases are things where you combine multiple fields into one
value to validate them as a pair and then, since you've done all that
work, make them available via the form's data. Now it's not a showstopper
if this isn't possible, since you can make a method/property that does the
conversion from multiple form fields to one, but it's a bit of an
arbitrary restriction.
Anyway, something to think about. I'd forgotten about this situation, so
I'll have to reread the patch with that situation in mind.
--
Ticket URL: <http://code.djangoproject.com/ticket/6845#comment:24>
Django Code <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
-~----------~----~----~----~------~----~------~--~---