Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Last active November 11, 2019 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/60171f1d28548d2f8663cc709cd80cfa to your computer and use it in GitHub Desktop.
Save Allwin12/60171f1d28548d2f8663cc709cd80cfa to your computer and use it in GitHub Desktop.
from django.db.models import F
author = Author.objects.get(name='John')
author.blog_posts = F('blog_posts') + 1
author.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment