On Aug 1, 2013, at 4:05 PM, Tom Evans <tevans...@googlemail.com> wrote:

> qs = ...
> print len(qs)
> print qs[0]
> print qs[-1]
> print qs[0]
> 
> How many queries for this?

Just one and "qs[-1]" will return the last element of the cached result.

I'm not trying to be pedantic, I'm just pointing out that a queryset becomes a 
different beast once it has been evaluated; it's basically a simple list of 
cached result.

-- 
Loic

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to