Skip to content

Instantly share code, notes, and snippets.

@townie
Created May 24, 2017 19:33
Show Gist options
  • Save townie/1e836e92f4e0bda0794d1a4590e2f19f to your computer and use it in GitHub Desktop.
Save townie/1e836e92f4e0bda0794d1a4590e2f19f to your computer and use it in GitHub Desktop.
Missing
_MISSING = object()
def update_method(user, first_name=_MISSING, last_name=_MISSING):
if first_name is not _MISSING:
user.first_name = first_name
if last_name is not _MISSING:
user.last_name = last_name
user.save() # or someshit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment