Bug 5920 - Secondary sorting criteria not working
Summary: Secondary sorting criteria not working
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6 M5
Assignee: David Reyna
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-03-06 15:52 UTC by Belen Barros Pena
Modified: 2014-04-02 11:35 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2014-03-06 15:52:49 UTC
When you sort a column where values are not unique (for example, Section or License) we need a second sorting criteria to use for the subset of values that share the same first column value. Second sorting criteria are specified as needed in the sorting design specifications (see attachments in bug 4255, bug 4264, bug 4280, bug 4298, bug 4327, bug 4383 and bug 4387).
Comment 1 Belen Barros Pena 2014-03-06 15:53:31 UTC
toaster/master:213fef6e87cbf60d773e28d31653e3c626d4058e
Comment 2 David Reyna 2014-03-26 06:03:09 UTC
According to the Django documentation:

"To order by multiple fields (where the second field is used to disambiguate ordering in cases where the first is the same), use multiple arguments:
That is, the correct invocation is: order_by('bedrooms', 'bathrooms')."

So, the solution is to add a "ordering_secondary" parameter to "_get_queryset", and have each class pass its respective secondary sort column name.
Comment 3 David Reyna 2014-04-02 07:01:16 UTC
commit 4638e52ed2e146c43890dc9fba28031f6cc583ad
Comment 4 Belen Barros Pena 2014-04-02 11:35:11 UTC
verified in master:3e528d3e4bc542ca2f654c54363c56af0fb9f61b