Changes between Initial Version and Version 1 of Ticket #24738, comment 3
- Timestamp:
- May 2, 2015, 4:52:54 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24738, comment 3
initial v1 3 3 I looked at #6707 and it isn't a problem about M2M in admin I'm talking about. Installed the master branch from github and tested. 4 4 5 MyI'm trying to delete all objects from the database that doesn't have any relation by signaling that the relationship has been changed with the "m2m_changed" signal.5 I'm trying to delete all objects from the database that doesn't have any relation by signaling that the relationship has been changed with the "m2m_changed" signal. 6 6 7 7 If I delete a model through the shell with "<object>.delete()", then no "m2m_changed" signal is sent that any relations has been changed in any way. … … 52 52 }}} 53 53 54 No signal is sent at delet etion of a related object to that changed the relations by deleting the object. Sorry but it isn't a duplication.54 No signal is sent at deletion of a related object when the relation was broken by deleting the object. Sorry but it isn't a duplication. Because I don't get any output that the signal function has run as when I ran the "add"-relation function and the related objects are still there without any relation to a object. If I uncomment the second function that catch a "pre_delete" and explicitly call "clear()" on the M2M-field I receive a "m2m_changed" signal and all records without a related object are deleted. According to docs "m2m_changed" was a signal that is sent when the relationship between the 2 objects are changed, which happen when the object is deleted. 55 55 56 56 Entire code: