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 foreignkey objects, method exists if null=true. if related field can’t set none (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

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -