rsinger86/django-lifecycle

Add a common gotchas or FAQ in the documentation

EnriqueSoria opened this issue · 3 comments

  • Many to many fields:
  • Admin bulk delete:
  • Bulk operations
  • Cascade delete:
  • Adding hooks to 3rd-party objects
  • Not inheriting from Lifecycle
  • Bad MRO:

Would it be possible to also state somewhere that this library works on save() and delete() methods and not with django signals? What I mean by that is when I used this library for the first time for BEFORE/AFTER_DELELE hooks. I assumed these will get triggered always, even object or queryset delete() method is used. But this is not the case when queryset delete() method is used. After checking the library source code I noticed that signals are not used, hence custom delete hook will not get called when queryset delete() is used.

This issue relates a bit to the issue I opened earlier as well when when my delete hook didn't get called.

Would it be possible to also state somewhere that this library works on save() and delete() methods and not with django signals? What I mean by that is when I used this library for the first time for BEFORE/AFTER_DELELE hooks. I assumed these will get triggered always, even object or queryset delete() method is used. But this is not the case when queryset delete() method is used. After checking the library source code I noticed that signals are not used, hence custom delete hook will not get called when queryset delete() is used.

This issue relates a bit to the issue I opened earlier as well when when my delete hook didn't get called.

Yeah, we will have to add something like this to explain why it doesn't work on queryset methods. Thanks for the suggestion!

Add gotcha with has_changed when combined with fields translated using django-modeltranslation