Skip to content

Instantly share code, notes, and snippets.

@goutomroy
Last active June 7, 2019 16:40
Show Gist options
  • Save goutomroy/942661cfa48cd4664d1ba5286812feea to your computer and use it in GitHub Desktop.
Save goutomroy/942661cfa48cd4664d1ba5286812feea to your computer and use it in GitHub Desktop.
# len() evaluates and saves results to cache.
queryset = Entry.objects.all()
ln = len(queryset)
# Using cache from previous 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