django - AttributeError: 'RelatedManager' object has no attribute 'remove' -
somewhere in code says
publisher.publisherperson_set.remove(email__in=pp_remove_set) upon executing this, got
attributeerror: 'relatedmanager' object has no attribute 'remove'
and indeed: looked @ dir(publisher.publisherperson_set) , had plenty of operations (including add), not remove.
under circumstances possible?
cannot null
the documentation relatedmanager.remove() says
for
foreignkeyobjects, method exists ifnull=true. if related field can’t setnone(null), object can’t removed relation without being added another.
obvious, once think it.
intended this:
publisher.publisherperson_set.filter(email__in=pp_remove_set).delete()
Comments
Post a Comment