Skip to content

Instantly share code, notes, and snippets.

@philippeowagner
Last active February 20, 2017 15:44
Show Gist options
  • Select an option

  • Save philippeowagner/5fc23a4cd28df78c0d9d to your computer and use it in GitHub Desktop.

Select an option

Save philippeowagner/5fc23a4cd28df78c0d9d to your computer and use it in GitHub Desktop.
Django > reload current object from DB
class Object(models.Model):
def reload(self):
"""
Reload object from the database
"""
return Object.objects.get(pk=self.pk)
@PetrDlouhy
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment