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