Add answers to REST API

This commit is contained in:
Raphael Michel
2017-07-02 16:34:55 +02:00
parent a530eda9fc
commit 0dc82b6a28
4 changed files with 45 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ class OrderViewSet(viewsets.ReadOnlyModelViewSet):
def get_queryset(self):
return self.request.event.orders.prefetch_related(
'positions', 'positions__checkins', 'positions__item',
'positions', 'positions__checkins', 'positions__item', 'positions__answers', 'positions__answers__options'
).select_related(
'invoice_address'
)
@@ -98,7 +98,7 @@ class OrderPositionViewSet(viewsets.ReadOnlyModelViewSet):
def get_queryset(self):
return OrderPosition.objects.filter(order__event=self.request.event).prefetch_related(
'checkins',
'checkins', 'answers', 'answers__options'
).select_related(
'item', 'order', 'order__event', 'order__event__organizer'
)