Slide 50
Slide 50 text
djangocon 2011 9/8/2011
Model Invalidation is
Hard
def OriginalStateModel(Model):
...
def __init__(self, *args, **kwargs):
super(StateModel, self).__init__(*args, **kwargs)
# preserve state after loading
self.preserve_state()
def save(self, *args, **kwargs):
super(OriginalStateModel, self).save(*args, **kwargs)
# db save and signal handlers have already happened
# preserve state after saving
self.preserve_state()