django-lifecycle icon indicating copy to clipboard operation
django-lifecycle copied to clipboard

Add a common gotchas or FAQ in the documentation

Open EnriqueSoria opened this issue 1 year ago • 3 comments

  • Many to many fields:
    • #120
  • Admin bulk delete:
    • #142
    • #74
    • #152
  • Bulk operations
    • #18
  • Cascade delete:
    • #89
  • Adding hooks to 3rd-party objects
    • #62
  • Not inheriting from Lifecycle
  • Bad MRO:
    • #96

EnriqueSoria avatar Nov 04 '23 06:11 EnriqueSoria

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.

Kazhuu avatar Nov 29 '23 06:11 Kazhuu

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!

EnriqueSoria avatar Nov 29 '23 10:11 EnriqueSoria

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

EnriqueSoria avatar Feb 09 '24 17:02 EnriqueSoria