This is a feature that is on it's way. It was originally planned for
v1.0, but had to be deferred. Honza Kral worked on the feature for the
Google Summer of Code this year. If you search the archives for "model
validation", you can find out more details.
> I can define my integrity constraints in the validation for the forms
> that act on the model, but this clearly breaks the "don't repeat
> yourself" principle, as I would have to repeat these constraints in
> every form (class) that I write.
>
> I could also override my model's save() method, but I don't think I
> would be able do anything about invalid data other than refuse to
> write them to the database. I don't think there's an exception
>
> I hope my question is clear. I'm quite the Django novice. Can anyone
> please tell me if I'm missing something?
You've pretty much captured the current situation as well as the ways
that you can respond.
Yes, the current situation is less than ideal, and yes, this is a
feature we want to add - hopefully it will be in v1.2.
Yours,
Russ Magee %-)