In one model, I have this:
class MyModel(models.Model):
relations = models.ManyToManyField(OtherModel)
....
and if I choose:
my_object.relations.remove(other_model_object)
it works.
How to remove all objects from the relations? my_object.relations.clean()
is not working.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…