Created
September 21, 2013 09:43
-
-
Save loic/6648972 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Django doesn't fire signals for parent Models. | |
# https://code.djangoproject.com/ticket/9318 | |
def _save_table(self, raw=False, cls=None, force_insert=False, | |
force_update=False, using=None, update_fields=None): | |
if cls is not self.__class__: | |
signals.pre_save.send(sender=cls, instance=self, | |
raw=raw, using=using, update_fields=update_fields) | |
updated = super(Node, self)._save_table(raw, cls, force_insert, | |
force_update, using, update_fields) | |
if cls is not self.__class__: | |
signals.post_save.send(sender=cls, instance=self, created=(not updated), | |
raw=raw, using=using, update_fields=update_fields) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment