I believe that doing [1:3] and [3:10] separately will result in two database
queries - it evaluates on the the slice. If you wanted to curl that into one
call, then it would be up to you to do your original slice as [1:10] and
then pull out the pieces for your internal loops as needed.

-joe

On 1/18/07, David Zhou <[EMAIL PROTECTED]> wrote:


Hi all,

I'm a little confused about when querysets are evaluated.

Supposing that my generic is passed a queryset = entries where
entires = Entry.objects.all(), would the queryset be evaluated when I
first start a for loop in the template?

What if I want to slice it in two for loops?  For example, if I have
[1:3] and [3:10].  Would that actually be two separate database calls
with limit 3 and limit 10, or is Django smart enough to recognize and
slice only the combined list of [1:10]?

Also, if there's someplace where evaluation is explained in more
detail, I'd appreciate it if someone could point me that way.  I
foudn a little bit about when it gets evaluated in the docs for the
DB API, but it was fairly light on the details.

Thanks!


---
David Zhou
[EMAIL PROTECTED]




>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to