I have an M2M relationship like this:
class Foo:
# foo fields...
class Bar:
Foos = ManytoManyField(Foo)
I am trying to add a foo to the list of foos attributed to a Bar, so here's what I have:
if Foo not in Bar.Foos:
Bar.Foos.add(Foo)
Question: is the if-judgment really necessary?
Thanks