您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

14 行
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)