_collect_sub_objects() does not take the database into the account
|Reported by:||gavoja||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The implementation of
delete() seem to be designed to remove all the related objects from the database that was passed via using argument, as the line below states:
The only problem is that the related object collection that takes place befor this call, does not take the database into the account. The proposed patch solves this problem.
I also found a couple occurences of direct _collect_sub_objects() call outside the
base.py which I haven't check tho, but the patch should be backward compatible.