I have a model with two ManyToManyField
s referring to a Position model. When a Position instance is deleted, I would like to have the same behaviour in the admin as for a ForeignKey, i.e. cascade deletion + a message asking for confirmation with the list of the objects that will be deleted.
How can I do that?
class Task(models.Model):
start_positions = models.ManyToManyField(Position, related_name='start_pos')
end_positions = models.ManyToManyField(Position, related_name='end_pos')
# more stuff
EDIT
I'm aware of this question: Django - Cascade deletion in ManyToManyRelation, but it has no proper answer.