Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Sahil590
requested review from
AdrianDAlessandro and
TinyMarsh
and
a balanced review from Copilot
November 5, 2026 11:48
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The production requirements omit django-filter, so adding django_filters to INSTALLED_APPS causes Docker’s collectstatic step to fail with ModuleNotFoundError and blocks production image builds.
1 open issue
What changed in this PR
Replaces the learning-resource page’s manual search filtering with django-filter, adopting the table-filtering approach requested in #798.
Changes:
- Moves cross-field search into
LearningResourceFilterand integrates it with the table view. - Renders the search field with crispy forms, preserves sorting on submission, and adds a reset link.
- Adds filtering and pagination tests, plus dependency and tooling configuration.
| File | Description |
|---|---|
tests/main/test_main_views.py |
Tests the search form, empty results, sorting, and pagination. |
tests/main/test_filters.py |
Tests field matching, whitespace handling, and duplicate prevention. |
requirements.txt |
Adds django-filter to runtime dependencies. |
pyproject.toml |
Declares django-filter and its mypy override. |
main/views/page_views.py |
Integrates FilterView with the learning-resource table. |
main/templates/main/pages/learning-resources.html |
Renders the filter field and adds sorting preservation and reset. |
main/filters.py |
Defines the cross-field learning-resource search filter. |
doc-requirements.txt |
Updates documentation dependencies to include django-filter. |
direct_webapp/settings/settings.py |
Registers django-filter in installed apps. |
dev-requirements.txt |
Updates development dependencies to include django-filter. |
.pre-commit-config.yaml |
Adds django-filter to the mypy hook environment. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
I followed the django filter docs to replace the existing hard coed search implementation. I was going to attempt adding htmx to have the search results appear as you type in a different PR.
I did use copilot for the tests and docstrings.
Fixes #798 (issue)
Type of change
Key checklist
python -m pytest)mkdocs serve)pre-commit run --all-files)Further checks