#9015: Signal Connection Decorators
-------------------------------------+--------------------------------------
          Reporter:  zvoase          |         Owner:  zvoase 
            Status:  assigned        |     Milestone:         
         Component:  Core framework  |       Version:  SVN    
        Resolution:                  |      Keywords:  signals
             Stage:  Accepted        |     Has_patch:  1      
        Needs_docs:  1               |   Needs_tests:  1      
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by anon):

 wouldn't it be nicer to have the decorator like this?

 {{{
 from django.db.models.signals import connect, pre_save

 # Decorator with no args.
 @connect(pre_save)
 def recvr1(sender, instance, *args, **kwargs):
     pass # ...

 # Decorator with keyword args.
 @connect(pre_save, sender=MyModel)
 def recvr2(sender, instance, *args, **kwargs):
     pass # ...
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9015#comment:8>
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-updates@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