5 messages in com.googlegroups.pylons-discussPatch for webhelpers/pagination/orm.p...
FromSent OnAttachments
Christoph Haas30 Jan 2007 07:11 
Ben Bangert30 Jan 2007 20:18 
Daniel Néri31 Jan 2007 00:11 
Christoph Haas31 Jan 2007 01:22 
Shannon -jj Behrens01 Feb 2007 19:01 
Subject:Patch for webhelpers/pagination/orm.py to raise proper exception
From:Christoph Haas (emai@public.gmane.org)
Date:01/30/2007 07:11:15 AM
List:com.googlegroups.pylons-discuss

The webhelpers.pagination.paginate call fails miserably if an object is given as the first parameter that is a proper SQLObject class or SQLAlchemy query. The error message was "You shouldn't have this" which doesn't tell the user what went wrong. And the error was even passed back and displayed on the web page. So I thought raising an exception might be a better way. Proposal

================================================================ --- webhelpers/pagination/orm.py (Revision 1776) +++ webhelpers/pagination/orm.py (Arbeitskopie) @@ -27,7 +27,8 @@ return SQLAlchemyLazyMapper(obj, *args, **kw) if isinstance(obj, sqlalchemy.Table): return SQLAlchemyLazyTable(obj, *args, **kw) - return "You shouldn't have this" + raise "You must call paginate() with either a sequence, an SQLObject "+ + "class or an SQLAlchemy query object."

class SQLObjectLazy(Partial): ================================================================

Kindly... Christoph