> Is there anyone else interested in this?

yes, I'd be interested in seeing some sort of database-level 
CHECK constraint as part of Django.  I had been sitting on my 
thoughts until I see the GSoC work done on model-validation wend 
its way towards trunk.  My hope had been to see model validation 
incorporate some DB-level CHECK constraints where feasible.

One of the other difficulties involves database expression 
differences.  For the simple cases such as you suggest, it's not 
as bad as they're fairly standard.  However, when functions are 
involved, each DB seems to have its own family of functions. 
E.g. if you want to assert the length of a string is 10 
characters ("len" vs. "strlen"?) or the time is during business 
hours ("hour(fieldname) between 8 and 17"...extracting 
time-portions varies across DB engines).

I currently just add the CHECK constraints manually (well, in 
post-syncdb code).  Having them in a declarative fashion would 
help keep them in the right place.

-tim




--~--~---------~--~----~------------~-------~--~----~
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 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to