When in your first example you call `[0]` it replaced earlier
`[22:44]` slicing.

In second example before `[0]` slice query set is converted into list
(for `repr` call and output) and then you apply `[0]` to result list.

On Jun 7, 7:54 pm, birkin <[EMAIL PROTECTED]> wrote:
> I just posted some command-line interactive output at:
>
> http://dpaste.com/hold/55270/
>
> The gist of the problem:
>
> >>> second_bunch = Subject.objects.all().order_by('name')[22:44]
> >>> second_bunch[0] # shows unexpected output
>
> <Subject: Africana>
>
> ...but...
>
> >>> second_bunch = Subject.objects.all().order_by('name')[22:44]
> >>> second_bunch
>
> [<Subject: History>, (subjects snipped), <Subject: Urban Policy>]>>> 
> second_bunch[0] # shows expected outuput
>
> <Subject: History>
>
> Essentially, if I don't list the output of 'second-bunch', it contains
> the whole queryset instead of the specified sliced range.
>
> I know there is lazy querying, but I thought that the command
> 'second_bunch[0]' would force the proper sliced-range query.
>
> I'd appreciate help understanding this.
--~--~---------~--~----~------------~-------~--~----~
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