On Nov 3, 5:28 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > I did write that if I use @paginate('iquery', ...) then I get the
> > "InvalidRequestError: This operation requires a Query against a single 
> > mapper."
> > traceback. So, no this is not a misspelling as far as I can tell. Do you 
> > have
> > any other suggestions?
>
> I'm sorry, I just now read your last mail again, and found the mentioned
> InvalidRequestError.
>
> However, your renaming does not solve the problem - it's simply
> obfuscating it. You need to have the same names for paginate to work.
>
> The decorator works by using webhelpers.paginate. I don't know why that
> is not working for the query you produce - but as a small workaround
> (just for testing), you could put a list() around the query-result in
> the controller. That would fetch it as whole, and make the list subject
> to pagination.
>
> However, you must eventually tackle the problem of the query not being
> proper pagable. Might be more of an SA-issue though.
>
> Diez

Diez,

You were right on the money with the suggestion to use a list() around
the sa query object. When I used it the decorator started working
"magically" :). So, there is a sa or @paginate bug or an error in the
webhelpers.paginate documentation as the latter mentions that a sa
query object can be passed to the decorator "The collection can be: an
SQLAlchemy query - e.g.: Session.query(MyModel)".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to