On Tue, 2007-08-21 at 03:54 -0700, pk11 wrote:
> hi all,
> 
> a while back(http://groups.google.com/group/django-developers/
> browse_thread/thread/fef854223b97e49c/c0e0ccce78369f05?
> lnk=gst&q=validation+aware+models&rnum=4#c0e0ccce78369f05) there was a
> discussion about adding a way to perform validation before saving an
> object.
> 
> As far as I see we could
> 
> 1) add a simple method like this to the db api:
> http://code.djangoproject.com/ticket/5101

Since there's slightly more work required than just calling validate()
there, I've wontfixed that ticket for now. It's not really necessary at
the moment (since you can do it manually if you want) and Jacob's more
complete solution that we thrashed out at OSCON will fill in the missing
bits. Missing things at the moment include having access to "self" in
model validation functions, having access to the correct Python types
(rather than strings, as now), being as close to fully backwards
compatible as possible (because oldforms still exists for now),
correctly updating functions like form_for_model() and
form_for_instance() to enable people to split form and model validation
responsibilities and possibly some other things I've forgotten.

> 2) merge the check constraints project to trunk (is it going to
> happen?)

Given that the Summer of Code project only finished about 24 hours ago,
it's probably a little early for this discussion. We would expect it to
garner some experience from wider use before thinking about merging it.

Note that check-constraints doesn't solve everything for everybody
because your model's validation requirements might be more restrictive
than your database table's. So we can't just push everything down to the
lowest level.

Regards,
Malcolm

-- 
The cost of feathers has risen; even down is up! 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to