Commit e301e2d9 by Tom Christie

Adding 'view or viewset' to docs appropriate.

parent d985aec3
...@@ -43,7 +43,8 @@ The default authentication schemes may be set globally, using the `DEFAULT_AUTHE ...@@ -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): class ExampleView(APIView):
authentication_classes = (SessionAuthentication, BasicAuthentication) authentication_classes = (SessionAuthentication, BasicAuthentication)
......
...@@ -94,7 +94,8 @@ You must also set the filter backend to `DjangoFilterBackend` in your settings: ...@@ -94,7 +94,8 @@ You must also set the filter backend to `DjangoFilterBackend` in your settings:
## Specifying filter fields ## 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): class ProductList(generics.ListAPIView):
queryset = Product.objects.all() queryset = Product.objects.all()
......
...@@ -34,7 +34,8 @@ The default set of parsers may be set globally, using the `DEFAULT_PARSER_CLASSE ...@@ -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): class ExampleView(APIView):
""" """
......
...@@ -39,7 +39,8 @@ If not specified, this setting defaults to allowing unrestricted access: ...@@ -39,7 +39,8 @@ If not specified, this setting defaults to allowing unrestricted access:
'rest_framework.permissions.AllowAny', '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): class ExampleView(APIView):
permission_classes = (IsAuthenticated,) permission_classes = (IsAuthenticated,)
......
...@@ -27,7 +27,8 @@ The default set of renderers may be set globally, using the `DEFAULT_RENDERER_CL ...@@ -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): class UserCountView(APIView):
""" """
......
...@@ -40,7 +40,8 @@ The default throttling policy may be set globally, using the `DEFAULT_THROTTLE_C ...@@ -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. 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): class ExampleView(APIView):
throttle_classes = (UserThrottle,) throttle_classes = (UserThrottle,)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment