Date: Tue, 15 Jul 2014 15:02:49 +0100
Subject: [PATCH] Latest docs
---
api-guide/authentication.html | 24 ++++++++++++----
api-guide/content-negotiation.html | 24 ++++++++++++----
api-guide/exceptions.html | 24 ++++++++++++----
api-guide/fields.html | 24 ++++++++++++----
api-guide/filtering.html | 28 +++++++++++++------
api-guide/format-suffixes.html | 24 ++++++++++++----
api-guide/generic-views.html | 24 ++++++++++++----
api-guide/pagination.html | 24 ++++++++++++----
api-guide/parsers.html | 24 ++++++++++++----
api-guide/permissions.html | 27 ++++++++++++++----
api-guide/relations.html | 24 ++++++++++++----
api-guide/renderers.html | 24 ++++++++++++----
api-guide/requests.html | 24 ++++++++++++----
api-guide/responses.html | 24 ++++++++++++----
api-guide/reverse.html | 24 ++++++++++++----
api-guide/routers.html | 24 ++++++++++++----
api-guide/serializers.html | 24 ++++++++++++----
api-guide/settings.html | 24 ++++++++++++----
api-guide/status-codes.html | 24 ++++++++++++----
api-guide/testing.html | 24 ++++++++++++----
api-guide/throttling.html | 24 ++++++++++++----
api-guide/views.html | 24 ++++++++++++----
api-guide/viewsets.html | 24 ++++++++++++----
index.html | 28 ++++++++++++++-----
topics/2.2-announcement.html | 24 ++++++++++++----
topics/2.3-announcement.html | 24 ++++++++++++----
topics/ajax-csrf-cors.html | 24 ++++++++++++----
topics/browsable-api.html | 24 ++++++++++++----
topics/browser-enhancements.html | 24 ++++++++++++----
topics/contributing.html | 24 ++++++++++++----
topics/credits.html | 24 ++++++++++++----
topics/documenting-your-api.html | 24 ++++++++++++----
topics/release-notes.html | 24 ++++++++++++----
topics/rest-framework-2-announcement.html | 24 ++++++++++++----
topics/rest-hypermedia-hateoas.html | 24 ++++++++++++----
topics/writable-nested-serializers.html | 24 ++++++++++++----
tutorial/1-serialization.html | 24 ++++++++++++----
tutorial/2-requests-and-responses.html | 24 ++++++++++++----
tutorial/3-class-based-views.html | 24 ++++++++++++----
.../4-authentication-and-permissions.html | 24 ++++++++++++----
.../5-relationships-and-hyperlinked-apis.html | 24 ++++++++++++----
tutorial/6-viewsets-and-routers.html | 24 ++++++++++++----
tutorial/quickstart.html | 24 ++++++++++++----
43 files changed, 823 insertions(+), 220 deletions(-)
diff --git a/api-guide/authentication.html b/api-guide/authentication.html
index 890914691..bc61cdd2f 100644
--- a/api-guide/authentication.html
+++ b/api-guide/authentication.html
@@ -33,6 +33,21 @@
})();
+
@@ -189,11 +204,9 @@
Hawk HTTP Authentication
HTTP Signature Authentication
-
-
-
-
-
+
+
+
@@ -505,6 +518,7 @@ class ExampleAuthentication(authentication.BaseAuthentication):
+
+
@@ -174,11 +189,9 @@
Example
Setting the content negotiation
-
-
-
-
-
+
+
+
@@ -276,6 +289,7 @@ class NoNegotiationView(APIView):
+
+
@@ -181,11 +196,9 @@
UnsupportedMediaType
Throttled
-
-
-
-
-
+
+
+
@@ -313,6 +326,7 @@ class ServiceUnavailable(APIException):
+
+
@@ -196,11 +211,9 @@
Third party packages
DRF Compound Fields
-
-
-
-
-
+
+
+
@@ -459,6 +472,7 @@ class ColourField(serializers.WritableField):
+
+
@@ -186,11 +201,9 @@
Third party packages
Django REST framework chain
-
-
-
-
-
+
+
+
@@ -355,15 +368,13 @@ class ProductFilter(django_filters.FilterSet):
This enables us to make queries like:
http://example.com/api/products?manufacturer__name=foo
-This is nice, but it shows underlying model structure in REST API, which may
-be undesired, but you can use:
+This is nice, but it exposes the Django's double underscore convention as part of the API. If you instead want to explicitly name the filter argument you can instead explicitly include it on the FilterSet
class:
import django_filters
from myapp.models import Product
from myapp.serializers import ProductSerializer
from rest_framework import generics
class ProductFilter(django_filters.FilterSet):
-
manufacturer = django_filters.CharFilter(name="manufacturer__name")
class Meta:
@@ -520,6 +531,7 @@ class ProductFilter(django_filters.FilterSet):
+
+
@@ -172,11 +187,9 @@
format_suffix_patterns
Accept headers vs. format suffixes
-
-
-
-
-
+
+
+
@@ -251,6 +264,7 @@ def comment_list(request, format=None):
+
+
@@ -194,11 +209,9 @@
Third party packages
Django REST Framework bulk
-
-
-
-
-
+
+
+
@@ -475,6 +488,7 @@ class BaseRetrieveUpdateDestroyView(MultipleFieldLookupMixin,
+
+
@@ -178,11 +193,9 @@
Third party packages
DRF-extensions
-
-
-
-
-
+
+
+
@@ -334,6 +347,7 @@ class CustomPaginationSerializer(pagination.BasePaginationSerializer):
+
+
@@ -184,11 +199,9 @@
MessagePack
CamelCase JSON
-
-
-
-
-
+
+
+
@@ -340,6 +353,7 @@ def parse(self, stream, media_type=None, parser_context=None):
+
+
@@ -187,11 +202,9 @@
Composed Permissions
REST Condition
-
-
-
-
-
+
+
+
@@ -223,6 +236,9 @@ or if you override the get_object
method on a generic view, then yo
self.check_object_permissions(self.request, obj)
return obj
+Limitations of object level permissions
+For performance reasons the generic views will not automatically apply object level permissions to each instance in a queryset when returning a list of objects.
+Often when you're using object level permissions you'll also want to filter the queryset appropriately, to ensure that users only have visibility onto instances that they are permitted to view.
Setting the permission policy
The default permission policy may be set globally, using the DEFAULT_PERMISSION_CLASSES
setting. For example.
REST_FRAMEWORK = {
@@ -383,6 +399,7 @@ class BlacklistPermission(permissions.BasePermission):
+
+
@@ -188,11 +203,9 @@
Third Party Packages
DRF Nested Routers
-
-
-
-
-
+
+
+
@@ -584,6 +597,7 @@ In the 2.4 release, these parts of the API will be removed entirely.