forked from CGM_Public/pretix_original
- [x] Data model - [x] CRUD - [x] Editor - [x] Migration from old settings - [x] Clone files when copying events - [x] badges? - [x] Actual ticket output - [x] Default layout on event creation - [x] Link well from ticketing settings - [x] Tests - [x] Shipping plugin - [x] Migration - [x] Settings - [x] Create default - [x] API
This commit is contained in:
31
src/pretix/plugins/ticketoutputpdf/api.py
Normal file
31
src/pretix/plugins/ticketoutputpdf/api.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from rest_framework import viewsets
|
||||
|
||||
from pretix.api.serializers.i18n import I18nAwareModelSerializer
|
||||
from pretix.api.serializers.order import CompatibleJSONField
|
||||
|
||||
from .models import TicketLayout, TicketLayoutItem
|
||||
|
||||
|
||||
class ItemAssignmentSerializer(I18nAwareModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = TicketLayoutItem
|
||||
fields = ('item',)
|
||||
|
||||
|
||||
class TicketLayoutSerializer(I18nAwareModelSerializer):
|
||||
layout = CompatibleJSONField()
|
||||
item_assignments = ItemAssignmentSerializer(many=True)
|
||||
|
||||
class Meta:
|
||||
model = TicketLayout
|
||||
fields = ('id', 'name', 'default', 'layout', 'background', 'item_assignments')
|
||||
|
||||
|
||||
class TicketLayoutViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
serializer_class = TicketLayoutSerializer
|
||||
queryset = TicketLayout.objects.none()
|
||||
lookup_field = 'id'
|
||||
|
||||
def get_queryset(self):
|
||||
return self.request.event.ticket_layouts.all()
|
||||
Reference in New Issue
Block a user