On 25 Set, 22:31, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> You should consider using a custom ModelForm[1] instead of this
> approach. Override its clean() method to perform your checks and throw
> a ValidationError when you don't want the save to proceed. You can
> then also make the Admin use
> I have two models, one of them has a many to many relation to the
> other one.
>
> I want to add some checks to the first model, so I overwrote the save
> method. If my checks are not ok, I plan not to call super().save(),
> but this gives me the error "'FirstModel' instance needs to have a
>
I have two models, one of them has a many to many relation to the
other one.
I want to add some checks to the first model, so I overwrote the save
method. If my checks are not ok, I plan not to call super().save(),
but this gives me the error "'FirstModel' instance needs to have a
primary key
3 matches
Mail list logo