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

Opened 12 years ago

Last modified 12 years ago

[PATCH] to paginate.py to add default_reversed argument

Reported by: chrismiles Owned by:
Priority: normal Milestone: 1.0.2
Component: unassigned Version: 1.0
Severity: normal Keywords:
Cc:

Description

The @paginate decorator is missing an option to specify the ordering to be reversed by default. There is talk of prepending the column name with "-", but this doesn't work (not with SQLAlchemy anyway - maybe it is SQLObject specific?).

This patch adds a parameter "default_reversed" to @paginate that indicates whether the default_order option is reversed by default. This should work independently of the ORM used.

Example use:

@paginate('media', default_order='timestamp', default_reversed=True)

Obviously it defaults to False, if not specified.

Attachments

paginate_default_reversed_patch.diff Download (952 bytes) - added by chrismiles 12 years ago.
patch to paginate.py to add default_reversed argument

Change History

Changed 12 years ago by chrismiles

patch to paginate.py to add default_reversed argument

comment:1 Changed 12 years ago by faide

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

Applied at r2946 in 1.0 and r2947 in trunk. Thanks once again Chris :)

Note: See TracTickets for help on using tickets.