You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 line
352 B

  1. from rest_framework import viewsets
  2. from api import models
  3. from api.permissions import IsOwner
  4. from api.serializers import SiteSerializer
  5. class SiteViewSet(viewsets.ModelViewSet):
  6. serializer_class = SiteSerializer
  7. permission_classes = (IsOwner,)
  8. def get_queryset(self):
  9. return models.Site.objects.filter(user=self.request.user)