On May 17, 12:07 am, Daniel Roseman <
roseman.dan...@googlemail.com>
wrote:
I've been encountering the same problem. It's especially frustrating
because it seems model validation used to be much easier in Django
(see
http://www.cotellese.net/2007/12/11/adding-model-field-validation-to-the-django-admin-page/
).
ajohnsen, you might want to see the Q&A I started over at Stack
Overflow recently:
http://stackoverflow.com/questions/849142/how-to-limit-the-maximum-value-of-a-numeric-field-in-a-django-model
Can anyone explain to me why model validation has been cut down so
arbitrarily? I mean, it's odd that one can specify *some* aspects of
what counts as valid for a particular field of a model (for instance:
how many decimal places a number can have; whether a number can be
negative; the maximum length of a character field; etc) but not others
(e.g. the maximum value of a number field).
Are the Django devs working to re-create model validation in a way
that would bring this missing functionality back to Django, or do they
think that people really ought to be breaking DRY by having to put
this stuff in every form that references a model for which you have
custom (though not uncommon) validation requirements? Or is there some
other way to do this that is better than both the aforementioned
options?
Thanks in advance for your help!
Sam