-
Notifications
You must be signed in to change notification settings - Fork 3
resource category #1188
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
resource category #1188
Conversation
| }, | ||
| }, | ||
| "free": {"type": "boolean"}, | ||
| "is_learning_material": {"type": "boolean"}, |
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.
is_learning_material is staying in the index (but not shown in the results) since it is used in the default search. I forgot to add it to the mapping previously
ChristopherChudzicki
left a comment
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 👍 Just the suggestion about underscore vs space
learning_resources/constants.py
Outdated
| video_playlist = "Video Playlist" | ||
|
|
||
|
|
||
| LEARNING_MATERIAL_RESOURCE_CATEGORY = "learning material" |
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.
| LEARNING_MATERIAL_RESOURCE_CATEGORY = "learning material" | |
| LEARNING_MATERIAL_RESOURCE_CATEGORY = "learning_material" |
27481da to
b5b76b4
Compare
|
pre-commit.ci run |
What are the relevant tickets?
closes https://github.com/mitodl/hq/issues/4727
Description (What does it do?)
This pr adds resource_category as a serializer field and a filter for the /learning_resource and /learning_resources_search apis. It removes is_learning_material as a filter and aggregation for /learning_resources_search
How can this be tested?
Run docker-compose run web ./manage.py recreate_index --all
Go to http://localhost:8063/api/v1/learning_resources/
Verify that the resource_category filter works, for example http://localhost:8063/api/v1/learning_resources/?resource_category=learning+material
Got to http://localhost:8063/api/v1/learning_resources_search
Verify that the resource_category filter works, for example http://localhost:8063/api/v1/learning_resources_search/?resource_category=learning+material
Verify that aggregations work with resource_category http://localhost:8063/api/v1/learning_resources_search/?aggregations=resource_category
Go to http://localhost:8063/api/v1/schema/redoc and verify that the documentation looks good