1👍
✅
You can unpack the QuerySet in the call to remove. You can do this leveraging the reverse query ability of M2M fields in Django.
Get the object that you are removing the objects off of (the one that rel_foobar is a field on):
objs = Foobar.objects.get(to_remove=1)
container = Container.objects.get(id=1)
container.rel_foobar.remove(*objs)
Source:stackexchange.com