Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save goutomroy/77042f82b64da9a3c5d62f2dba36e643 to your computer and use it in GitHub Desktop.
Save goutomroy/77042f82b64da9a3c5d62f2dba36e643 to your computer and use it in GitHub Desktop.
# You can't use filter to queryset anymore.
queryset = Entry.objects.all()[10:100]
# You can use filter to q1 but not to q2, q3.
q1 = Entry.objects.all()
q2 = q1[1:10]
q3 = q2[1:5]
# saves results to cache of q1
lst1 = [each.blog.id for each in q1]
# saves results to cache of q2
lst2 = [each.blog.id for each in q2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment