Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1434 (closed enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

[patch] @paginate should handle SQLAlchemy Query objects

Reported by: rejoc Owned by: roger.demetrescu
Priority: normal Milestone: 1.0.4
Component: SQLAlchemy Version: trunk
Severity: normal Keywords:
Cc:

Description

As SelectResults? is going deprecated, @paginate should also handle Query objects.

Attachments

paginate.py.patch Download (1.7 KB) - added by rejoc 10 years ago.
patch proposal
paginate.py.2.patch Download (816 bytes) - added by vhata 10 years ago.
Additional patch

Change History

comment:1 Changed 10 years ago by rejoc

  • Type changed from defect to enhancement
  • Summary changed from @paginate should handle SQLAlchemy Query objects to [patch] @paginate should handle SQLAlchemy Query objects

Changed 10 years ago by rejoc

patch proposal

comment:2 Changed 10 years ago by faide

  • Owner changed from anonymous to faide
  • Status changed from new to assigned

comment:3 Changed 10 years ago by faide

This is in the tube for inclusion before 1.0.3 is out. Thx!

comment:4 Changed 10 years ago by faide

Committed in r3258 (1.0.3dev) and r3259 (1.1dev). And thanks again for the patch :)

comment:5 Changed 10 years ago by faide

  • Status changed from assigned to closed
  • Resolution set to fixed

Changed 10 years ago by vhata

Additional patch

comment:6 Changed 10 years ago by vhata

  • Status changed from closed to reopened
  • Resolution fixed deleted

The above patch still doesn't work - it assumes that Query objects have a _query attribute which holds the query object. This is only true for SelectResults? objects.

Patch attached.

comment:7 Changed 10 years ago by paj

  • Component changed from TurboGears to SQLAlchemy

comment:8 Changed 10 years ago by paj

  • Version changed from 1.0.2 to trunk
  • Milestone changed from 1.0.3 to 1.0.4

Seems like a sensible patch. We need to also create unit tests and update the PaginateDecorator? documentation.

comment:9 Changed 10 years ago by roger.demetrescu

I confirm vhata's patch works fine here...

comment:10 Changed 10 years ago by roger.demetrescu

Just for the record, ticket #1582 has the vhata's patch, but with some modification...

Cheers,

Roger

comment:11 Changed 10 years ago by roger.demetrescu

  • Owner changed from faide to roger.demetrescu
  • Status changed from reopened to new

comment:12 Changed 10 years ago by roger.demetrescu

  • Status changed from new to closed
  • Resolution set to fixed

Fixed at [3525] and [3526]. Thanks !

Note: See TracTickets for help on using tickets.