On Sun, Oct 11, 2009 at 10:23 PM, Jason S. <[email protected]> wrote:
>
> The query() and filter() functions both return query objects, not
> result lists. This is very useful because you can chain together
> multiple filters, order_bys, etc, but at the end you need to call .all
> () to get a list (or .first() to get one object)
>

Well, yes. But paginate.Page is supposed to work with query objects.

I don't see the reason why it does not work for Garyc. The code
snippet seems correct.

--
Gael

> On Oct 11, 1:48 pm, gazza <[email protected]> wrote:
>> Hello,
>>
>> I am seeing a problem when attempting to use the paginator.
>>
>> records= meta.Session.query(model.A).filter(mddel.A.tag==id)
>>
>> c.paginator = paginate.Page(
>>                  records,
>>                  page=int(request.params.get('page',1)),
>>                  items_per_page =2,
>> )
>>
>> I am seeing the error:
>>
>> Sorry yor collection type is not supported by the paginate module, You
>> can either provide a list, a tuple, and SQLAlchemy 0.4 select object
>> etc.
>>
>> The line its complaining on is "items_per_page".
>>
>> If somebody could be kind enough to enlighten me on the problem that
>> would be great.
>>
>> Thanks,
>> Garyc
> >
>

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

Reply via email to