mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-10 16:40:55 +03:00
Docs fix
This commit is contained in:
parent
ce5e8f8946
commit
3eaad89c16
|
@ -99,7 +99,8 @@ For example:
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
from myapp.serializers import UserSerializer
|
from rest_framework.response import Response
|
||||||
|
from myapp.serializers import UserSerializer, PasswordSerializer
|
||||||
|
|
||||||
class UserViewSet(viewsets.ModelViewSet):
|
class UserViewSet(viewsets.ModelViewSet):
|
||||||
"""
|
"""
|
||||||
|
@ -176,7 +177,7 @@ Note that you can use any of the standard attributes or method overrides provide
|
||||||
permission_classes = [IsAccountAdminOrReadOnly]
|
permission_classes = [IsAccountAdminOrReadOnly]
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return request.user.accounts.all()
|
return self.request.user.accounts.all()
|
||||||
|
|
||||||
Also note that although this class provides the complete set of create/list/retrieve/update/destroy actions by default, you can restrict the available operations by using the standard permission classes.
|
Also note that although this class provides the complete set of create/list/retrieve/update/destroy actions by default, you can restrict the available operations by using the standard permission classes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user