Project

General

Profile

Actions

Feature #4008

closed

QueryModel: Consider supporting a custom ORDER BY for sort()

Added by Bruce Toll over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Benoit Daccache
Target version:
Start date:
04/26/2015
Due date:
% Done:

0%

Estimated time:

Description

The QueryModel sort() method currently provides for ascending or descending sorts on a single column, but in some cases it would be useful to be able to include additional fields in a sort, e.g. to break ties on the primary field.

The WSortFilterProxyModel is helpful, but in some cases it may be simpler and more efficient to handle sorting in the SQL query.

The QueryModel sort() method is virtual, however it accesses private members and does not appear to be designed for derived classes to override.

An attached patch, for your review, adds a new public method createOrderBy() that separates out the creation of the ORDER BY clause from the rest of the sort() logic. It should be backwards compatible and includes a test/example. The patch was tested with the github version of Wt, 3.3.3-48-g051edee (3.4.0+3?).


Files

Actions #1

Updated by Koen Deforche over 9 years ago

  • Status changed from New to InProgress
  • Assignee set to Benoit Daccache
Actions #2

Updated by Benoit Daccache over 9 years ago

  • Status changed from InProgress to Resolved
Actions #3

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by Koen Deforche about 9 years ago

  • Target version set to 3.3.5
Actions

Also available in: Atom PDF