Try to apply the following patch on WebHelpers (don't know how to
attach a file with Google interface, hope that indent will work):

--- webhelpers/pagination/orm.py.orig   2008-03-10 15:06:31.000000000
+0100
+++ webhelpers/pagination/orm.py        2008-03-10 15:06:59.000000000
+0100
@@ -25,7 +25,7 @@
     if orms.get('sqlalchemy'):
         if hasattr(obj, '_is_primary_mapper') or \
            (not sqlalchemy.__version__.startswith('0.4') and \
-            isinstance(obj, sqlalchemy.Query)):
+            isinstance(obj, sqlalchemy.orm.Query)):
             return SQLAlchemyLazyMapper(obj, *args, **kw)
         if hasattr(obj, 'mapper') and hasattr(obj, 'select') and
hasattr(obj, 'count'):
             return SQLAlchemyLazyMapper(obj, *args, **kw)


On Mar 24, 11:38 pm, Ross Vandegrift <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I was trying to movbe some custom pagination code over to the paginate
> module and ran into a problem.
>
> My code look like this:
>         v = model.sac.query(model.Vlan)
>         ...
>         v = v.filter_by(...)
>         c.page = paginate.Page(v, current_page=page_nr)
>
> Paginate bounces me the error: "exceptions.TypeError: Sorry, your
> collection type is not supported by the paginate module. You can
> either provide a list, a tuple, an SQLAlchemy table or an SQLAlchemy
> query object."
>
> Pylons error handling middleware confirms that v is a SQLAlchemy query
> object:
>
> v       <sqlalchemy.orm.query.Query object at 0xb0d6a80c>
>
> What's up with that?
>
> --
> Ross Vandegrift
> [EMAIL PROTECTED]
>
> "The good Christian should beware of mathematicians, and all those who
> make empty prophecies. The danger already exists that the mathematicians
> have made a covenant with the devil to darken the spirit and to confine
> man in the bonds of Hell."
>         --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
--~--~---------~--~----~------------~-------~--~----~
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