2007/12/4, Adrian Holovaty <[EMAIL PROTECTED]>:
> No -- I guess I didn't explain myself well enough. In this case, I
> wouldn't use limit(). I have two goals:
>
>     * Retrieve all objects in the table.
>     * Do something special with the first one (once the whole list has
> been retrieved).
>
> The ideal API would look like this, and it would only run a single query:
>
>     objects = MyModel.objects.filter(site=1)
>     first_one = objects[0]

Maybe introduce a resolve() or results() call that just returns list(self)?

-- 
Patryk Zawadzki
PLD Linux Distribution

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to