Skip to content
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

Merged
merged 8 commits into from
Oct 18, 2018
Merged

Adds OrderingFilter to Search API #725

merged 8 commits into from
Oct 18, 2018

Conversation

Miserlou
Copy link
Contributor

@Miserlou Miserlou commented Oct 9, 2018

Issue Number

AlexsLemonade/refinebio-frontend#372 (comment)

Purpose/Implementation Notes

Adds filters.OrderingFilter to FilterBackends.

Methods

Uses ordering_fields = '__all__' since we have no sensitive data here.

Types of changes

  • New feature (non-breaking change which adds functionality)

Functional tests

New assertions added

@arielsvn
Copy link
Contributor

Will this allow sorting by the number of samples?

@Miserlou
Copy link
Contributor Author

It does now.

Copy link
Contributor

@kurtwheeler kurtwheeler left a 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!

filter_class = ExperimentFilter

# Ordering
ordering_fields = ('samples_count', 'id', 'created_at', 'accession_code',)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Miserlou Miserlou merged commit 525d681 into dev Oct 18, 2018
kurtwheeler pushed a commit that referenced this pull request Jan 10, 2019
Adds OrderingFilter to Search API
@wvauclain wvauclain deleted the mis/order branch July 9, 2019 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants