aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/generic-views.md
diff options
context:
space:
mode:
authorEthan Fremen2013-06-10 10:29:25 -0700
committerEthan Fremen2013-06-10 10:29:25 -0700
commit0e75bcd2592caa8862e0b0166a6b851a3eada749 (patch)
tree4be625563775f1cab06219d3a7a5a62c0ff74bfd /docs/api-guide/generic-views.md
parentde00ec95c3007dd90b5b01f7486b430699ea63c1 (diff)
parent5d0aeef69ecec70242513195c19edcb622e14371 (diff)
downloaddjango-rest-framework-0e75bcd2592caa8862e0b0166a6b851a3eada749.tar.bz2
Merge remote-tracking branch 'upstream/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