Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
Created March 31, 2011 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradmontgomery/897134 to your computer and use it in GitHub Desktop.
Save bradmontgomery/897134 to your computer and use it in GitHub Desktop.
class MyModel(models.Model):
status = models.IntegerField()
stuff = models.ForeignKey()
def save(self, force_insert=False, force_update=False):
#if something has happened with stuff:
# update status
super(MyModel, self).save(force_insert, force_update)
# My Gues is that for Django 1.2 or 1.3, I just replace
# def save(self, force_insert=False, force_update=False):
# with
# def save(self, *args, **kwargs):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment