Tim Van Steenburgh wrote:
> I'm currently using PaginateDataGrid to display sortable/pageable SQLAlchemy
> result sets (which are just lists by default). Had to modify
> paginate.pyand paginate_datagrid.kid to get it working. Not sure if
> my solution if the
> "right" way, but it works. Diffs are attached if anyone cares to look.
>
Using SelectResults for SQLAlchemy has the advantage of only pulling
records from the database that will be displayed and also the sorting
is done in the database. If you've got a large dataset (several pages)
this can make a difference. In addition, it keeps the code simpler in
paginate.py because SQLObject's and SQLAlchemy's SelectResults have the
same API. Creating a SelectResults instance is simple.
from sqlalchemy.ext.selectresults import SelectResults
sr = SelectResults(query)
If I read your code right, it looks like you added sorting for lists,
which is another feature that is needed I think.
Randall
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---