Ability to sort by more than one column
Open
Nobody has claimed this yet.
feature
- Dominant language
- Python
- Stars
- 11.5k
- Forks
- 904
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 18
Description
Split off from #189.
I'd like to support "sort by X descending, then by Y ascending if there are dupes for X" as well. Suggested syntax for that:
?_sort_desc=X&_sort=Y
we currently only allow one argument to be sent. We should allow as many arguments as there are columns, for example:
?_sort=department&_sort_desc=precinct&_sort=age&_sort_desc=size
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the issue. Start by locating the current handling of the single _sort and _sort_desc query arguments, then trace how they become the database ordering. Done means supporting repeated sort arguments with the documented precedence and covering the example ordering behavior with tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- api, database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100