Skip to content

Instantly share code, notes, and snippets.

@brettmcintosh
Created October 20, 2016 01:13
Show Gist options
  • Save brettmcintosh/48482c3bcc4ae2075f91d449a160eaca to your computer and use it in GitHub Desktop.
Save brettmcintosh/48482c3bcc4ae2075f91d449a160eaca to your computer and use it in GitHub Desktop.
Do you know how to use F expressions? I don't
>>> models.F(None)
F(None)
>>> models.F(None) >= 1
True
>>> models.F(None) + 1 >= 1
True
>>> models.F(None) + 1
<CombinedExpression: F(None) + Value(1)>
"""
https://docs.djangoproject.com/en/1.9/ref/models/expressions/#f-expressions
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment