Hello all

i'm running into a problem using pylons 0.10-1 on debian squeeze.
i've found the very same problem exposed here, but without any
solution yet.

i'm trying gain some pylons skill trought james gardner's pylonsbook.

but can't paginate using a sqlachemy object query i get a typeError:

here is the snipet i'm using:

def list(self):
          page_q = meta.Session.query(model.Page)
          c.paginator = paginate.Page(
              page_q,
              page=int(request.params.get('page', 1)),
              items_per_page = 2,
              controller='page',
              action='list',
          )
          return render('/derived/page/list.html')


Off course if i use meta.Session.query(model.Page).all() it works,
but, if i understand well it makes sqlalchemy querying all the pages
and then display only the needed one instead of querying only the
needed one.

throught the interactive debugger i typed page_q which confirm page_q
is a sqlalchemy query object:


>>> page_q
<sqlalchemy.orm.query.Query object at 0x3729fd0>
>>> print page_q
SELECT page.id AS page_id, page.content AS page_content, page.posted
AS page_posted, page.title AS page_title, page.heading AS page_heading
FROM page
>>> paginate
<module 'webhelpers.paginate' from '/usr/local/lib/python2.6/dist-
packages/WebHelpers-0.6.4-py2.6.egg/webhelpers/paginate.pyc'>


and one last thing i don't understand, is that python says me i'm
using WebHelpers-0.6.4 while aptitude says it is python-
webhelpers1.1-1

so i'm definetly not blocked in my learning, but i take this as an
opportunity to dive in pylons's core trying to understand what's wrong.

-- 
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