Re: Queryset unexpectedly turning into list

2009-01-28 Thread mb0...@googlemail.com
> "Normally" (which might well mean "hopefully") it shouldn't matter > whether you're getting back an iterator or a list (which is still > iterable) at that point in the code. I could imagine or construct code > that behaves differently in the two cases, but do you have a real-life > case where th

Re: Queryset unexpectedly turning into list

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 19:57 -0800, mb0...@googlemail.com wrote: > Ah, ok thanks for the explanation :) Alex's explanation is correct (as his explanations tend to be). I just wanted to add some extra thoughts to that... "Normally" (which might well mean "hopefully") it shouldn't matter whether yo

Re: Queryset unexpectedly turning into list

2009-01-24 Thread mb0...@googlemail.com
Ah, ok thanks for the explanation :) --~--~-~--~~~---~--~~ 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

Re: Queryset unexpectedly turning into list

2009-01-24 Thread Alex Koshelev
All magic happens in line: if(queryset):#check if query returned somethin To perform this check QuerySet is evaluated and makes query to DB and stores result in list. After that QuerySet slice operation make real slice on underlying cache and of cource return list. On Sun, Jan 25, 2009 at 1:26

Re: Queryset unexpectedly turning into list

2009-01-24 Thread Ramiro Morales
On Sat, Jan 24, 2009 at 8:26 PM, mb0...@googlemail.com wrote: > > Hi, > > please have a look at: http://dpaste.com/112603/ > > Can someone tell me why the sliced queryset suddenly turns into a > list? > I'm still new to Python/Django so I can't tell if it is a bug... but > it sure cost me some ti

Queryset unexpectedly turning into list

2009-01-24 Thread mb0...@googlemail.com
Hi, please have a look at: http://dpaste.com/112603/ Can someone tell me why the sliced queryset suddenly turns into a list? I'm still new to Python/Django so I can't tell if it is a bug... but it sure cost me some time because in my eyes it was something complete out of the blue. Django versio