reorganized viewsets into their own files
This commit is contained in:
parent
83982877c3
commit
2e7dbe4ddc
13 changed files with 330 additions and 277 deletions
13
users/viewsets/group.py
Normal file
13
users/viewsets/group.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from knox.auth import TokenAuthentication
|
||||
from django.contrib.auth.models import Group
|
||||
from rest_framework import viewsets, permissions, status
|
||||
|
||||
from users.serializers import GroupSerializer
|
||||
|
||||
|
||||
class GroupViewSet(viewsets.ModelViewSet):
|
||||
authentication_classes = [TokenAuthentication]
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
queryset = Group.objects.all().order_by("name")
|
||||
serializer_class = GroupSerializer
|
Loading…
Add table
Add a link
Reference in a new issue