-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adds OrderingFilter to Search API #725
Conversation
Will this allow sorting by the number of samples? |
It does now. |
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.
There's one comment that probably makes sense to address, but it's up to you and otherwise LGTM!
api/data_refinery_api/views.py
Outdated
filter_class = ExperimentFilter | ||
|
||
# Ordering | ||
ordering_fields = ('samples_count', 'id', 'created_at', 'accession_code',) |
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.
Could we use source_first_published
instead of created_at
since users probably don't care when we discovered the sample existed?
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.
Done
Adds OrderingFilter to Search API
Issue Number
AlexsLemonade/refinebio-frontend#372 (comment)
Purpose/Implementation Notes
Adds
filters.OrderingFilter
toFilterBackends
.Methods
Uses
ordering_fields = '__all__'
since we have no sensitive data here.Types of changes
Functional tests
New assertions added