25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
478 B

  1. from api import models, serializers
  2. from api.permissions import IsOwner
  3. from rest_framework import permissions, viewsets
  4. class PasswordViewSet(viewsets.ModelViewSet):
  5. serializer_class = serializers.PasswordSerializer
  6. permission_classes = (permissions.IsAuthenticated, IsOwner,)
  7. search_fields = ('site', 'email',)
  8. ordering_fields = ('site', 'email', 'created')
  9. def get_queryset(self):
  10. return models.Password.objects.filter(user=self.request.user)