Last active
December 17, 2015 20:19
-
-
Save peterbe/5667124 to your computer and use it in GitHub Desktop.
Doing a Django ORM save without triggering signals.
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
def non_signal_save(obj, **kwargs): | |
obj.__class__.objects.filter(pk=obj.pk).update(**kwargs) | |
# e.g. non_signal_save(blogpost, modified=hour_ago) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful if you have something like this: