#14051: Signals for transaction commit/rollback
--------------------------------------------------------+-------------------
          Reporter:  Ask Solem <a...@celeryproject.org>  |         Owner:  
nobody
            Status:  new                                |     Milestone:        
         Component:  Database layer (models, ORM)       |       Version:  1.2   
        Resolution:                                     |      Keywords:        
             Stage:  Design decision needed             |     Has_patch:  1     
        Needs_docs:  0                                  |   Needs_tests:  0     
Needs_better_patch:  0                                  |  
--------------------------------------------------------+-------------------
Changes (by brodie):

 * cc: brodie (added)

Comment:

 Some thoughts:

  At first glance, the API seems kind of unwieldy. I think it'd be better
 to either have a set of on-commit signals for models, or to change post_*
 to only fire when a transaction is successful, and to include some kind of
 transaction ID in dispatch_uid.

 Regarding the example, how would you make the API proposed in the patch
 work in that case? How would user.pk be passed to the signal handler?

 I brought this ticket up to Russell at the Sydney sprint the other day,
 and he suggested implementing this functionality through a context
 manager. That might be something else to consider.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14051#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to