aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/generic-views.md
diff options
context:
space:
mode:
authorTom Christie2013-06-13 00:10:23 -0700
committerTom Christie2013-06-13 00:10:23 -0700
commit170709442bb3f53bd2b49414cdff0495e7d6c9eb (patch)
tree2168c40e527b3ff9cc54fbd14fdb823799bbf280 /docs/api-guide/generic-views.md
parentde00ec95c3007dd90b5b01f7486b430699ea63c1 (diff)
parent2ed79b6dc626cb2fcc1bfc119ef5757c590bb983 (diff)
downloaddjango-rest-framework-170709442bb3f53bd2b49414cdff0495e7d6c9eb.tar.bz2
Merge pull request #931 from mindlace-mp/writable-nested-modelserializer
Merged master into writable-nested-modelserializer.
Diffstat (limited to 'docs/api-guide/generic-views.md')
-rwxr-xr-xdocs/api-guide/generic-views.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md
index 20b9440b..cd1bc7a1 100755
--- a/docs/api-guide/generic-views.md
+++ b/docs/api-guide/generic-views.md
@@ -60,7 +60,7 @@ The following attributes control the basic view behavior.
* `queryset` - The queryset that should be used for returning objects from this view. Typically, you must either set this attribute, or override the `get_queryset()` method.
* `serializer_class` - The serializer class that should be used for validating and deserializing input, and for serializing output. Typically, you must either set this attribute, or override the `get_serializer_class()` method.
-* `lookup_field` - The field that should be used to lookup individual model instances. Defaults to `'pk'`. The URL conf should include a keyword argument corresponding to this value. More complex lookup styles can be supported by overriding the `get_object()` method.
+* `lookup_field` - The field that should be used to lookup individual model instances. Defaults to `'pk'`. The URL conf should include a keyword argument corresponding to this value. More complex lookup styles can be supported by overriding the `get_object()` method. Note that when using hyperlinked APIs you'll need to ensure that *both* the API views *and* the serializer classes use lookup fields that correctly correspond with the URL conf.
**Shortcuts**:
@@ -131,7 +131,7 @@ You may want to override this method to provide more complex behavior such as mo
For example:
def get_paginate_by(self):
- self.request.accepted_renderer.format == 'html':
+ if self.request.accepted_renderer.format == 'html':
return 20
return 100