alexadrien
8/7/2018 - 12:51 PM

Django serializer slug look up

Django serializer slug look up

from rest_framework import viewsets
from api.intranet_section.serializers import IntranetSectionSerializer
from api.wagtail_pages.models import IntranetSection


class InstanceViewSet(viewsets.ModelViewSet):
    queryset = IntranetSection.objects.all()
    serializer_class = IntranetSectionSerializer
    lookup_field = 'slug'