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 value before a many-to-many relationship can be used."

As far as I understood, the problem is that since I don't create the
entry in the db for the first model, the successive creation of the
association between the two models fails.

Is there a way to stop the creation of all entries when the save
method in my first model is called?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to