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