Skip to content
Snippets Groups Projects

refactor collection filters with django_filters

Merged Konrad Mohrfeldt requested to merge refactor-filters into master

This MR aims to re-implement existing collection filters in api viewsets that are implemented in get_queryset methods with django-filter filtersets.

This has multiple advantages:

  • DRF will auto-generate a filter form for the filterset fields when browsing the API with the browser, making it easier to browse & filter collections.
  • Filter values can easily be validated and most are validated out-of-the-box.
  • Filter documentation can be added per filter.
  • django_filter is supported by drf-spectecular, which will generate a nice and tidy OpenAPI documentation for us.
Edited by Konrad Mohrfeldt

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading