Last active
June 7, 2019 22:48
-
-
Save goutomroy/c85ecf2fd47fd294dd3b5e4b76490c9f 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
# Don't | |
for entry in Entry.objects.all(): | |
entry.likes += 1 | |
entry.save() | |
# Do | |
Entry.objects.update(likes=F('likes') + 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment