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 #1410 (closed enhancement: fixed)

Opened 10 years ago

Last modified 9 years ago

[PATCH] Allow pagination of multiple variables

Reported by: beef Owned by: faide
Priority: normal Milestone: 1.0.4
Component: TurboGears Version: 1.0.2
Severity: normal Keywords:
Cc:

Description

This patch allows pagination of multiple variables, simply by using the @paginate decorator multiple times on a particular controller. It maintains backwards compatibility with previous code, but introduces a new template variable: tg.paginates

This is a dictionary, indexed by variable name, which contains Paginate instances for all the paginated variables.

One can then use tg.paginatessome_var_name? in the same way that tg.paginate was previously used.

Attachments

paginate_multiple.diff.gz Download (1.5 KB) - added by beef 10 years ago.
paginate_multiple_v2.diff Download (7.0 KB) - added by beef 10 years ago.
Second, better version of the patch.

Change History

Changed 10 years ago by beef

comment:1 Changed 10 years ago by faide

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

Sounds interesting I'll look into this :)

comment:2 Changed 10 years ago by faide

  • Type changed from defect to enhancement

Thanks for this patch! I'll look into the details of it asap.

One small remark : you should have attached the file in non-gzipped format so that trac preview could just display some nicely colored diff...

Changed 10 years ago by beef

Second, better version of the patch.

comment:3 Changed 10 years ago by beef

I made a better version of the patch.

It maintains (as much as possible) backwards compatibility with URIs generated by the previous paginate code.

And it doesn't pollute the URI with as many characters either.

Thanks,

Stuart

comment:4 Changed 10 years ago by faide

Thx again, we'll make sure to have this one in the next release...

comment:5 Changed 10 years ago by Chris Arndt

  • Milestone changed from 1.0.3 to 1.0.4

Batch promoting 1.0.3 tickets to Milestone 1.0.4

comment:6 Changed 10 years ago by faide

applied in r3492. It seemed to work for me for the last few days without bugs...

comment:7 Changed 9 years ago by roger.demetrescu

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

Closing the ticket.

Thanks for the good job, beef...

Note: See TracTickets for help on using tickets.