mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-23 11:04:49 +00:00
19 lines
499 B
Python
19 lines
499 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from rest_framework.generics import RetrieveUpdateAPIView, ListAPIView
|
|
from .serializers import UserSerializer
|
|
|
|
|
|
class UsersView(ListAPIView):
|
|
queryset = User.objects.all()
|
|
serializer_class = UserSerializer
|
|
|
|
|
|
class UserView(RetrieveUpdateAPIView):
|
|
serializer_class = UserSerializer
|
|
queryset = User.objects.all()
|
|
|
|
def get_object(self):
|
|
return self.queryset.get(pk=self.request.user.id)
|