Hi,

On 04/27/2015 08:17 AM, Christopher Adams wrote:
> So wrote an
> <https://docs.google.com/document/d/1VtSduRYtAIZa4sOFvj_H0f3JfgXxf_vbxQ4RTlFBags/edit?usp=sharing>RFC
> <https://docs.google.com/document/d/1VtSduRYtAIZa4sOFvj_H0f3JfgXxf_vbxQ4RTlFBags/edit?usp=sharing>
>  and a
> prototype
> <https://github.com/django/django/compare/django:master...adamsc64:modelsignal_sent_after_commit?expand=1>
> branch in Django to defer the invocation of certain handlers registered
> with Django model signals optionally until after transaction commit. Any
> thoughts?

Thanks for putting the work into writing up this clear proposal, with
prototype code!

I agree that it would be good to have the ability in Django to run code
after-commit, but I think that feature is more useful it it's not
coupled to the signals framework. It would be better to have a generic
way to say "run this code after the current transaction commits"; then
it's equally easy to make use of that hook in a model signal handler or
elsewhere.

I wrote django-transaction-hooks [1] to serve this use case. I think
probably something like django-transaction-hooks should be part of
Django core. I'd be interested in any feedback you have on it.

Carl

[1] https://django-transaction-hooks.readthedocs.org/en/latest/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/553E8942.8060300%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to