diff --git a/doc/api/resources/quotas.rst b/doc/api/resources/quotas.rst index a03a9af88..ec1b9b402 100644 --- a/doc/api/resources/quotas.rst +++ b/doc/api/resources/quotas.rst @@ -89,8 +89,8 @@ Endpoints :query integer page: The page number in case of a multi-page result set, default is 1 :query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``. Default: ``position`` - :query integer subevent: Only return quotas of the sub-event with the given ID. Can be passed multiple times to filter - for multiple sub-events. + :query integer subevent: Only return quotas of the sub-event with the given ID. + :query integer subevent__in: Only return quotas of sub-events with one the given IDs (comma-separated). :query string with_availability: Set to ``true`` to get availability information. Can lead to increased answer times. :param organizer: The ``slug`` field of the organizer to fetch :param event: The ``slug`` field of the event to fetch diff --git a/src/pretix/api/views/item.py b/src/pretix/api/views/item.py index bf49f0dd3..24ae8ea1a 100644 --- a/src/pretix/api/views/item.py +++ b/src/pretix/api/views/item.py @@ -52,7 +52,7 @@ from pretix.api.serializers.item import ( from pretix.api.views import ConditionalListView from pretix.base.models import ( CartPosition, Item, ItemAddOn, ItemBundle, ItemCategory, ItemVariation, - Question, QuestionOption, Quota, SubEvent, + Question, QuestionOption, Quota, ) from pretix.base.services.quotas import QuotaAvailability from pretix.helpers.dicts import merge_dicts @@ -459,11 +459,11 @@ class QuestionOptionViewSet(viewsets.ModelViewSet): with scopes_disabled(): class QuotaFilter(FilterSet): - subevent = django_filters.ModelMultipleChoiceFilter(queryset=SubEvent.objects.all()) - class Meta: model = Quota - fields = ['subevent'] + fields = { + 'subevent': ['exact', 'in'], + } class QuotaViewSet(ConditionalListView, viewsets.ModelViewSet):