Changes between Version 10 and Version 11 of Signals


Ignore:
Timestamp:
Oct 4, 2006, 11:11:57 PM (18 years ago)
Author:
James Bennett
Comment:

Add a couple notes about overriding methods in model subclasses

Legend:

Unmodified
Added
Removed
Modified
  • Signals

    v10 v11  
    101101'''pre_init'''
    102102
    103 Whenever you create a new instance of a Django model (for example, in [http://www.djangoproject.com/documentation/tutorial1/ the first part of the Django tutorial] when you do `p = Poll(question="What's up?", pub_date=datetime.now())`) , this signal is sent at the beginning of the execution of the model's `__init__` method.
     103Whenever you create a new instance of a Django model (for example, in [http://www.djangoproject.com/documentation/tutorial1/ the first part of the Django tutorial] when you do `p = Poll(question="What's up?", pub_date=datetime.now())`) , this signal is sent at the beginning of the execution of the model's `__init__` method. '''Note:''' if you override `__init__` on your model, you must call the parent class' `__init__` method for this signal to be sent, and it will be sent at the beginning of the parent class' `__init__` method.
    104104
    105105Arguments sent with this signal:
     
    111111'''post_init'''
    112112
    113 Like `pre_init`, but this one is sent when the model's `__init__` method is done executing.
     113Like `pre_init`, but this one is sent when the model's `__init__` method is done executing. '''Note:''' if you override `__init__` on your model, you must call the parent class' `__init__` method for this signal to be sent, and it will be sent at the end of the parent class' `__init__` method.
    114114
    115115Arguments sent with this signal:
     
    120120'''pre_save'''
    121121
    122 This is sent at the beginning of a model's `save` method.
     122This is sent at the beginning of a model's `save` method. '''Note:''' if you override `save` on your model, you must call the parent class' `save` method for this signal to be sent, and it will be sent at the beginning of the parent class' `save` method.
    123123
    124124Arguments sent with this signal:
     
    129129'''post_save'''
    130130
    131 This is sent at the end of a model's `save` method.
     131This is sent at the end of a model's `save` method. '''Note:''' if you override `save` on your model, you must call the parent class' `save` method for this signal to be sent, and it will be sent at the end of the parent class' `save` method.
    132132
    133133Arguments sent with this signal:
Back to Top