forked from CGM_Public/pretix_original
API: Allow to filter quota list for multiple subevents
This commit is contained in:
@@ -89,7 +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
|
||||
: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 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
|
||||
|
||||
@@ -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,
|
||||
Question, QuestionOption, Quota, SubEvent,
|
||||
)
|
||||
from pretix.base.services.quotas import QuotaAvailability
|
||||
from pretix.helpers.dicts import merge_dicts
|
||||
@@ -459,6 +459,8 @@ class QuestionOptionViewSet(viewsets.ModelViewSet):
|
||||
|
||||
with scopes_disabled():
|
||||
class QuotaFilter(FilterSet):
|
||||
subevent = django_filters.ModelMultipleChoiceFilter(queryset=SubEvent.objects.all())
|
||||
|
||||
class Meta:
|
||||
model = Quota
|
||||
fields = ['subevent']
|
||||
|
||||
Reference in New Issue
Block a user