mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Adding 'view or viewset' to docs appropriate.
This commit is contained in:
parent
d985aec3c9
commit
e301e2d974
|
@ -43,7 +43,8 @@ The default authentication schemes may be set globally, using the `DEFAULT_AUTHE
|
|||
)
|
||||
}
|
||||
|
||||
You can also set the authentication scheme on a per-view basis, using the `APIView` class based views.
|
||||
You can also set the authentication scheme on a per-view or per-viewset basis,
|
||||
using the `APIView` class based views.
|
||||
|
||||
class ExampleView(APIView):
|
||||
authentication_classes = (SessionAuthentication, BasicAuthentication)
|
||||
|
|
|
@ -94,7 +94,8 @@ You must also set the filter backend to `DjangoFilterBackend` in your settings:
|
|||
|
||||
## Specifying filter fields
|
||||
|
||||
If all you need is simple equality-based filtering, you can set a `filter_fields` attribute on the view, listing the set of fields you wish to filter against.
|
||||
If all you need is simple equality-based filtering, you can set a `filter_fields` attribute on the view, or viewset,
|
||||
listing the set of fields you wish to filter against.
|
||||
|
||||
class ProductList(generics.ListAPIView):
|
||||
queryset = Product.objects.all()
|
||||
|
|
|
@ -34,7 +34,8 @@ The default set of parsers may be set globally, using the `DEFAULT_PARSER_CLASSE
|
|||
)
|
||||
}
|
||||
|
||||
You can also set the renderers used for an individual view, using the `APIView` class based views.
|
||||
You can also set the renderers used for an individual view, or viewset,
|
||||
using the `APIView` class based views.
|
||||
|
||||
class ExampleView(APIView):
|
||||
"""
|
||||
|
|
|
@ -39,7 +39,8 @@ If not specified, this setting defaults to allowing unrestricted access:
|
|||
'rest_framework.permissions.AllowAny',
|
||||
)
|
||||
|
||||
You can also set the authentication policy on a per-view basis, using the `APIView` class based views.
|
||||
You can also set the authentication policy on a per-view, or per-viewset basis,
|
||||
using the `APIView` class based views.
|
||||
|
||||
class ExampleView(APIView):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
|
|
|
@ -27,7 +27,8 @@ The default set of renderers may be set globally, using the `DEFAULT_RENDERER_CL
|
|||
)
|
||||
}
|
||||
|
||||
You can also set the renderers used for an individual view, using the `APIView` class based views.
|
||||
You can also set the renderers used for an individual view, or viewset,
|
||||
using the `APIView` class based views.
|
||||
|
||||
class UserCountView(APIView):
|
||||
"""
|
||||
|
|
|
@ -40,7 +40,8 @@ The default throttling policy may be set globally, using the `DEFAULT_THROTTLE_C
|
|||
|
||||
The rate descriptions used in `DEFAULT_THROTTLE_RATES` may include `second`, `minute`, `hour` or `day` as the throttle period.
|
||||
|
||||
You can also set the throttling policy on a per-view basis, using the `APIView` class based views.
|
||||
You can also set the throttling policy on a per-view or per-viewset basis,
|
||||
using the `APIView` class based views.
|
||||
|
||||
class ExampleView(APIView):
|
||||
throttle_classes = (UserThrottle,)
|
||||
|
|
Loading…
Reference in New Issue
Block a user