Bug 5920

Summary: Secondary sorting criteria not working
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: David Reyna <david.reyna>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, cristiana.voicu, jessica.zhang
Version: unspecified   
Target Milestone: 1.6 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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