Merge lp:~adeuring/launchpad/bug-sorting into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Abel Deuring |
Approved revision: | no longer in the source branch. |
Merged at revision: | 14297 |
Proposed branch: | lp:~adeuring/launchpad/bug-sorting |
Merge into: | lp:launchpad |
Diff against target: |
236 lines (+119/-2) 2 files modified
lib/lp/bugs/model/bugtask.py (+30/-2) lib/lp/bugs/tests/test_bugtask_search.py (+89/-0) |
To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-sorting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Deryck Hodge (community) | code | Approve | |
Review via email: mp+82217@code.launchpad.net |
Commit message
[r=deryck][no-qa] bugtask sorting by milestone name
Description of the change
This branch allows to sort bug searches results by milestone name.
(part of https:/
This is basically a boilerplate addition of another entry to
the dictionary BugTaskSet.
specifying the order to table columns.
Since the milestone table is normally not included in the FROM clause
of an SQL query, I added slightly more complex data to this dictionary:
Aside from the sort expression, the entry for "milestone_name" contains
also the class Milestone itself and a LeftJoin. This data is used to
include the join in the list join_tables, which in turn used to build
the FROM clause.
I also explicitly added a "second order" sorting, since milestones are
not the most fine grained sort option: By default, the "second level
sort order" would be bug.id or bugtask.id (depending on the search target),
and this is in many use cases probably not very helpful.
test:
./bin/test bugs -vvt test_bugtask_
no lint
Looks good.