Last active
November 11, 2019 08:23
-
-
Save Allwin12/60171f1d28548d2f8663cc709cd80cfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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