[Fixed]-How can I tell if a django RelatedManager .add() found that the object was already added?

1👍

You could query the groups count before and after, to see if anything changed:

...
num_groups = parent.groups.count()
parent.groups.add(*groups)
if parent.groups.count() > num_groups:
   # Something was added
   parent.save()
...

Leave a comment