mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-23 11:04:49 +00:00
added users list
This commit is contained in:
parent
e7584eb47f
commit
9a8935d052
2 changed files with 8 additions and 1 deletions
|
|
@ -4,4 +4,5 @@ from .views import *
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', UserView.as_view(), name="user_view"),
|
path('', UserView.as_view(), name="user_view"),
|
||||||
|
path('list', UsersView.as_view(), name="users_view"),
|
||||||
]
|
]
|
||||||
|
|
@ -2,9 +2,15 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
from rest_framework.generics import RetrieveUpdateAPIView
|
from rest_framework.generics import RetrieveUpdateAPIView, ListAPIView
|
||||||
from .serializers import UserSerializer
|
from .serializers import UserSerializer
|
||||||
|
|
||||||
|
|
||||||
|
class UsersView(ListAPIView):
|
||||||
|
queryset = User.objects.all()
|
||||||
|
serializer_class = UserSerializer
|
||||||
|
|
||||||
|
|
||||||
class UserView(RetrieveUpdateAPIView):
|
class UserView(RetrieveUpdateAPIView):
|
||||||
serializer_class = UserSerializer
|
serializer_class = UserSerializer
|
||||||
queryset = User.objects.all()
|
queryset = User.objects.all()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue