Enrique Soria

Results 34 comments of Enrique Soria

As @dmartin said, Django itself doesn't call `.delete()` neither it fires related django signals, so we can't provide a general enough solution that works for everyone. As a workaround you...

As @eplutus said, this is a limitation of Django itself. It's explained [in the docs](https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#admin-actions), and it says some possible workarounds. I'm closing this as there's nothing more we can...

> I think you SHOULD update the documentation Yes, it would be nice to have a section in the documentation explaining common gotchas using this library. > why foreign keys...

> @EnriqueSoria thanks for your reply, but after more than a year since my comment I don't remember anymore the exact problem/scenario. haha understandable... anyway, I had to try

> I may be wrong, but i think that the problem is that hooks don't work as expected when the watched field (`parent` in the example below) is a `ForeignKey`....

I don't know how this could be done, because as @dralley says, it's required to subclass `LifecycleMixin`. If someone has some clues on how could this problem be solved, we're...

FYI this is what I do: https://blog.enriquesoria.com/mantainable-env-sample/

Your approach makes sense to me, except for having `using=None` as a parameter of `run` method. Where would you specify this parameter? If we remove it I think it could...

I personally haven't worked too much with multiple databases, and I'm not 100% sure if this is general enough that it would work for everyone. I would like to hear...

Thanks for this suggestion! I like the context manager approach, I've seen similar patterns in other projects like `django-modeltranslation`: https://github.com/deschler/django-modeltranslation/blob/2061f6c264d7cb889ae14d2d52a7547df6d58663/modeltranslation/utils.py#L133C13-L155 https://github.com/deschler/django-modeltranslation/blob/master/modeltranslation/thread_context.py#L9-L21 If you want to provide an implementation for this...