ccdb-api/ccdb/utils/viewsets.py
Matthew Dillon 910d3b4beb Admin Section API (#11)
Models for managing admin pages
2016-09-05 17:03:01 -07:00

17 lines
506 B
Python

from rest_framework import viewsets
from .models import AdminSection, AdminEntry
from .serializers import AdminSectionSerializer, AdminEntrySerializer
class AdminSectionViewSet(viewsets.ModelViewSet):
queryset = AdminSection.objects.all()
serializer_class = AdminSectionSerializer
class AdminEntryViewSet(viewsets.ModelViewSet):
queryset = AdminEntry.objects.all()
serializer_class = AdminEntrySerializer
def get_serializer_context(self):
return {'request': self.request}