Skip to content
Snippets Groups Projects

refactor collection filters with django_filters

Merged Konrad Mohrfeldt requested to merge refactor-filters into master
Compare changes
  • Side-by-side
  • Inline
Files
2
  • This change re-implements all existing collection filters for the
    APITimeSlotViewSet with a FilterSet. No breaking changes are expected,
    though there are some changes in semantics:
    
    * The start and end query parameters no longer need to be specified
      together. If users only want to modify the start or end date they
      can now do that.
      If start is specified and end is not, end will be start + 60 days.
    * If end was not set it would default to start + 60 days at 00:00.
      This is now fixed and end will be start + 60 days at 23:59:59.
    * end now uses time.max, which selects the latest possible time on
      the specified date.
    * The surrounding-filter now uses the value of the start filter
      by default. There might not be a use-case for this, but it seemed
      like a good default.
    * All filters are now applied in series. This wasn’t the case for
      every filter, e.g. the surrounding-filter would return early.
Loading