Skip to content

Instantly share code, notes, and snippets.

@jan-matejka
Created October 10, 2012 11:07
Show Gist options
  • Select an option

  • Save jan-matejka/3864816 to your computer and use it in GitHub Desktop.

Select an option

Save jan-matejka/3864816 to your computer and use it in GitHub Desktop.
class MyModel(models.Model)
def save(self, **kw):
super(Order, self).save(**kw)
if self.number is None:
self.number = gen_the_number(self.pk)
super(Order, self).save(**kw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment