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

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -