Skip to content

Instantly share code, notes, and snippets.

@jwasinger
Created January 6, 2015 18:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jwasinger/78af744d75bbd7cfdebe to your computer and use it in GitHub Desktop.
if not obj and pk:
obj = get_object_or_404(Klass, pk=pk)
elif not obj and pk:
raise Exception("pk or obj required.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment