diff --git a/api-guide/relations.html b/api-guide/relations.html index 218421979..7b4056dbf 100644 --- a/api-guide/relations.html +++ b/api-guide/relations.html @@ -6,7 +6,7 @@ - + @@ -185,6 +185,8 @@
PendingDeprecation
In the 2.3 release, these warnings will be escalated to a DeprecationWarning
, which is loud by default.
In the 2.4 release, these parts of the API will be removed entirely.
For more details see the 2.2 release announcement.
+
+Third Party Packages
+The following third party packages are also available.
+DRF Nested Routers
+The drf-nested-routers package provides routers and relationship fields for working with nested resources.
Many thanks to everyone who's contributed to the project.
django-oauth-plus
.all()
across nested serializer relationships, preventing erronous behavior with some non-ORM objects, and preventing unneccessary queryset re-evaluations.Date: 6th December 2013
@@ -288,7 +290,17 @@client.force_authenticate(None)
should also clear session info if it exists.FileField
.required=False
now consistently return None
.page=0
now simply returns the default page size, instead of disabling pagination. [*][*] Note that the change in page=0
behaviour fixes what is considered to be a bug in how clients can effect the pagination size. However if you were relying on this behavior you will need to add the following mixin to your list views in order to preserve the existing behavior.
class DisablePaginationMixin(object):
+ def get_paginate_by(self, queryset=None):
+ if self.request.QUERY_PARAMS['self.paginate_by_param'] == '0':
+ return None
+ return super(DisablePaginationMixin, self).get_paginate_by(queryset)
+
+Date: 16th August 2013
Rather than write multiple views we're grouping together all the common behavior into classes called ViewSets
.
We can easily break these down into individual views if we need to, but using viewsets keeps the view logic nicely organized as well as being very concise.
+Notice that our viewset classes here are a little different from those in the frontpage example, as they include queryset
and serializer_class
attributes, instead of a model
attribute.
For trivial cases you can simply set a model
attribute on the ViewSet
class and the serializer and queryset will be automatically generated for you. Setting the queryset
and/or serializer_class
attributes gives you more explicit control of the API behaviour, and is the recommended style for most applications.
Okay, now let's wire up the API URLs. On to tutorial/urls.py
...
from django.conf.urls import patterns, url, include