Skip to content
Snippets Groups Projects
  1. Mar 22, 2022
    • Konrad Mohrfeldt's avatar
      refactor: implement consistent pk/slug retrieval for shows · f7926bd9
      Konrad Mohrfeldt authored
      The show retrieve method allowed shows to be identified through the slug
      or the id. This is handy, but was restricted to the retrieve and did not
      apply to the update nor delete methods. The proper way to implement this
      kind of behaviour is through overriding get_object so that route
      identifiers are handled consistently.
      f7926bd9
  2. Mar 21, 2022
  3. Mar 17, 2022
    • Konrad Mohrfeldt's avatar
      refactor: use django_filters FilterSet for APINoteViewSet · 7eaa0a49
      Konrad Mohrfeldt authored
      This change re-implements all existing collection filters for the
      APINoteViewSet with a FilterSet. No breaking changes are expected.
      7eaa0a49
    • Konrad Mohrfeldt's avatar
      refactor: tidy up APIScheduleViewSet · 29837872
      Konrad Mohrfeldt authored
      * TODOs are no longer part of the method description
      * normalized queryset handling
      * consistent formatting of method descriptions.
      29837872
    • Konrad Mohrfeldt's avatar
      refactor: pre-fill show and timeslot data on note creation · b3247ab5
      Konrad Mohrfeldt authored
      If notes are created through subroutes some of the data necessary to
      create a note is already available through the route data and doesn’t
      need to be passed as part of the request body anymore.
      b3247ab5
    • Konrad Mohrfeldt's avatar
      fix: fix typo causing note creations to fail · 0dc2903b
      Konrad Mohrfeldt authored
      Notes will only be created if called through a timeslot subroute. The
      typo prohibited the note creation, because timeslot_pk was always None
      and caused the view to error early.
      0dc2903b
    • Konrad Mohrfeldt's avatar
      refactor: implement active filter for various viewsets · 2d9fd804
      Konrad Mohrfeldt authored
      APICategoryViewSet, APITypeViewSet, APITopicViewSet,
      APIMusicFocusViewSet, APIFundingCategoryViewSet, APILanguageViewSet, and
      APIHostViewSet all used the same base class implementing get_queryset
      for filtering by their active state. This is now handled by a generic
      FilterSet.
      2d9fd804
    • Konrad Mohrfeldt's avatar
      refactor: tidy up APIUserViewSet · cf82526d
      Konrad Mohrfeldt authored
      * normalized queryset handling
      * consistent formatting of method descriptions.
      cf82526d
    • Konrad Mohrfeldt's avatar
      fix: don’t advertise prohibited API methods · 60a791ae
      Konrad Mohrfeldt authored
      There is no point in advertising the methods by inheriting from
      the default CRUD viewset, if we don’t actually intend to implement them.
      60a791ae
    • Konrad Mohrfeldt's avatar
      refactor: use django_filters FilterSet for APITimeSlotViewSet · 6c8236d2
      Konrad Mohrfeldt authored
      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 accepts a datetime value and will be set
        to the current time if only the query parameter but no value
        has been set.
      * All filters are now applied in series. This wasn’t the case for
        every filter, e.g. the surrounding-filter would return early.
      6c8236d2
    • Konrad Mohrfeldt's avatar
      refactor: use django_filters FilterSet for APIShowViewSet · 0fed711d
      Konrad Mohrfeldt authored
      This change re-implements all existing collection filters for the
      APIShowViewSet with a FilterSet. No breaking changes are expected,
      though there are some changes in semantics:
      
      * The owner, host, musicfocus, language, category, and topic
        filters now accept multiple values (i.e. ?category=2,3)
      * The owner, host, musicfocus, language, category, topic, and type
        filter values are now validated and may be rejected as invalid if
        the referenced object does not exist.
      0fed711d
  4. Mar 15, 2022
  5. Mar 14, 2022
    • Ernesto Rico Schmidt's avatar
      Format source with Black · 0ace09e7
      Ernesto Rico Schmidt authored
      0ace09e7
    • Ernesto Rico Schmidt's avatar
      Refactor and Clean-up Viewsets · 5c34d059
      Ernesto Rico Schmidt authored
      - Reorder the code inside the methods to fail fast on autorization,
      - Replace `int_or_none` with a more generic solution, and move to utils,
      - Add `get_values` and move `pk_and_slug` as `get_pk_and_slug` into utils,
      - Replace calls to static methos in models local queries,
      - Return meaningful status code while creating and updating resources,
      - Return `409` when creating or updating a schedule produces a conflict.
      5c34d059
  6. Mar 08, 2022
  7. Feb 28, 2022
  8. Feb 25, 2022
  9. Feb 23, 2022
  10. Feb 14, 2022
  11. Feb 10, 2022
  12. Jan 25, 2022
  13. Jan 24, 2022
  14. Jan 19, 2022
  15. Jan 18, 2022
  16. Jan 17, 2022
  17. Jan 14, 2022
  18. Jan 13, 2022
  19. Jan 12, 2022
  20. Nov 26, 2021
  21. Nov 19, 2021
  22. Nov 18, 2021
Loading