Ticket #5910: signals.patch

File signals.patch, 1.4 KB (added by smurf@…, 8 years ago)
  • django/core/signals.py

    diff --git a/django/core/signals.py b/django/core/signals.py
    index 7a23607..ec0c201 100644
    a b  
    1 request_started = object()
    2 request_finished = object()
    3 got_request_exception = object()
     1class Signal(object):
     2    def __init__(self,name):
     3        self.name = name
     4    def __repr__(self):
     5        return "<Signal:%s>" % (self.name,)
     6    def __str__(self):
     7        return "Signal:%s" % (self.name,)
     8    def __unicode__(self):
     9        return u"Signal:%s" % (self.name,)
     10
     11request_started = Signal("request_started")
     12request_finished = Signal("request_finished")
     13got_request_exception = Signal("got_request_exception")
  • django/db/models/signals.py

    diff --git a/django/db/models/signals.py b/django/db/models/signals.py
    index 2171cb1..e4cae4f 100644
    a b  
    1 class_prepared = object()
     1from django.core.signals import Signal
    22
    3 pre_init= object()
    4 post_init = object()
     3class_prepared = Signal("class_prepared")
    54
    6 pre_save = object()
    7 post_save = object()
     5pre_init= Signal("pre_init")
     6post_init = Signal("post_init")
    87
    9 pre_delete = object()
    10 post_delete = object()
     8pre_save = Signal("pre_save")
     9post_save = Signal("post_save")
    1110
    12 post_syncdb = object()
     11pre_delete = Signal("pre_delete")
     12post_delete = Signal("post_delete")
     13
     14post_syncdb = Signal("post_syncdb")
Back to Top