Skip to content

Instantly share code, notes, and snippets.

@goutomroy
Last active June 7, 2019 16:41
Show Gist options
  • Save goutomroy/e2d1886d34e6be08a75f4aed48795a74 to your computer and use it in GitHub Desktop.
Save goutomroy/e2d1886d34e6be08a75f4aed48795a74 to your computer and use it in GitHub Desktop.
# Evaluates the queryset and saves results in cache.
queryset = Entry.objects.all()
lst = list(queryset)
# Using cache from previous list() evaluation.
for each in queryset:
print(each.headline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment