-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add alphabetical sorting as default (fixes #1415) #1416
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1416 +/- ##
==========================================
+ Coverage 75.00% 75.21% +0.20%
==========================================
Files 75 75
Lines 3449 3454 +5
Branches 554 555 +1
==========================================
+ Hits 2587 2598 +11
+ Misses 694 691 -3
+ Partials 168 165 -3
☔ View full report in Codecov by Sentry. |
@filipweidemann Thanks for creating this PR! Just a quick question: Since you seem to have run Can you add a test that verifies files are sorted? This feature got lost since a test did not cover it. It would be great if we fixed this for the future. |
@fsbraun okay good catch, running And yes, |
… else use file_qs" This reverts commit f34c560.
…ld instead of using Python sort
Okay @fsbraun, here we go. I reverted the I really was not happy with using So I did a quick refactoring and implemented the solution I already talked about inside the PR description. Would be nice if you could have a quick look & maybe kick off the CI again. If something is still unclear or needs another refactor, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work!
Hey, quick question: when will this get merged & released? I don't want to pressure anyone but a quick estimate would be nice because right now I'm thinking about shipping the fork to prod environments to bridge the gap until the release is there. But I would obviously avoid that if you're saying that this will be released this week or something :) Thanks! |
@filipweidemann Will release it the next days as 3.0.6. (Merged right now. - I typically do not merge immediately after reviewing to give other community members a chance of looking at it.) |
Great stuff, that's all I needed to know. :) |
Description
This PR intends to hotfix #1415 by reintroducing the
.sort()
function onfile_qs
inside thefiler/admin/folderadmin.py
logic.We did not modify any existing tests or added new ones because the function is returning rendered HTML and it is currently unclear how we could test this in an elegant way.
We are also aware that there are better ways to accomplish the same result, e.g. by using Django's
QuerySet.annotate
andCoalesce
DB functions to add a correct sort target to the queryset, so that.order_by()
works as intended.However, we did not want to refactor the existing solution right now but rather hotfix the (currently broken) behaviour.
Related resources
Checklist
master
Slack to find a “pr review buddy” who is going to review my pull request.