Ben,

It looks like filter will add a filter to the existing query object (instead
of creating a new query object like django does) but the fetch method will
retrieve the objects and return them immediately without modifying the
query. You should do something like:

items_list = items.fetch(10)

and then pass the items_list to your template.

Ian

On Wed, Jul 15, 2009 at 9:02 AM, Ben <bhym...@gmail.com> wrote:

>
> Hi, i am trying to limit the number of results returned on a query to
> 10, but i seem to be getting all results back instead of just 10.  Am
> i missing something with the fetch syntax?
>
> -----code-----
>    items = Item.all()
>    items.filter('adminOnly = ', False)
>    items.filter('status = ', 2)
>    items.order('-wins')
>    items.fetch(limit=10)
>
>
>    template_values = {
>      'userInfo': userInfo,
>      'appDetails': appConfig.details,
>      'items': items,
>      'links': links,
>      }
>
> -----/code----
>
> when i iterate through the results via django in the template it
> appears the query is properly applying the filters, and the order, but
> is returning all results that meet that criteria instead of just the
> first 10.
> >
>


-- 
=======================================
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianmle...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
=======================================

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to