-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Move dashboard API filter fields to model queryset filter fields #11330
Conversation
This moves a lot of dashboard JS/API logic into our standard FilterSet instances: - Project listing filter field - Version listing filter field - Build list version listing filter field To accomplish this, a few helper classes were added for making the fields easier to work with and display. Template and JS were updated in - readthedocs/ext-theme#351
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.
Looks good. I'm not sure to understand this 100% because of django filter deepness, but I didn't see anything that called my attention 👍🏼
@@ -36,7 +37,13 @@ class BuildListFilter(FilterSet): | |||
) | |||
|
|||
# Attribute filter fields | |||
version = CharFilter(field_name="version__slug", widget=HiddenInput) | |||
version__slug = FilteredModelChoiceFilter( |
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.
I like this pattern using model__field
👍🏼
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
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.
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This moves a lot of dashboard JS/API logic into our standard FilterSet
instances:
To accomplish this, a few helper classes were added for making the
fields easier to work with and display.
Template and JS were updated in