Hi!

2014/1/18 Aymeric Augustin <aymeric.augus...@polytechnique.org>

> On 18 janv. 2014, at 19:50, Carl Meyer <c...@oddbird.net> wrote:
>
> > Those interested in this feature may find django-transaction-hooks [1]
> useful. It is my attempt to implement the commonly-useful case (run some
> code after the current transaction successfully commits, providing the code
> wasn't registered during a savepoint which was later rolled back.) I think
> the API provided by django-transaction-hooks is actually better for that
> use case than transaction signals are, since it does the work of handling
> some situations correctly (savepoints, closed connections), which in the
> case of signals are left up to the signal receiver to handle (or more
> likely, not bother to handle.)
> >
> > Testing and feedback welcome. If this becomes widely used and seems to
> fill a need, I think there is a chance it could become part of Django core.
> (See #21803.)
>
> I think this is the right approach. I would use that package. I support
> adding it to Django.
>

You are absolutely right! This is much best approach than using signals (I
also don't like signals, my approach was only for show a use case).
And I think that this is much less intrusive (and without signals), and
would be awesome if it be added to django. This use case is very common in
web development.


> Since it doesn’t do anything until after the transaction has successfully
> committed, it cannot interfere with the transaction management code. That’s
> my most important requirement and the reason why I’m so strongly opposed to
> pre-commit/rollback signals.
>
> If you look at the first email in this thread, the use case is “do
> something when a transaction is committed successfully”. In the later email
> that gives an example, it only uses post_commit. Generic transaction
> signals look like a collective hallucination to me, or at least a pretty
> bad case of YAGNI.
>
> --
> Aymeric.


Thanks!

Greetings.
Andrey


-- 
Andrey Antukh - Андрей Антух - <andrei.anto...@kaleidos.net> / <n...@niwi.be
>
http://www.niwi.be <http://www.niwi.be/page/about/>
https://github.com/niwibe

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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/CAKn%3DmONTxxVA_HMHuMzxabL6zgG83f1NpUQyaoqV13LY5y%3DZ1A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to