diff options
| author | Tom Christie | 2014-12-07 14:29:05 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-07 14:29:05 +0000 |
| commit | 9879a5dcdc2e99dc2ebd23cd093a3e7ccec318fd (patch) | |
| tree | dd1394cbd532855dad1d9bc225433319f29743cc /docs/api-guide | |
| parent | 8553858e7364e17ef4225c2153e9bc6acd1e1255 (diff) | |
| parent | 9b468fba60def77144949628211aac95c6316c70 (diff) | |
| download | django-rest-framework-9879a5dcdc2e99dc2ebd23cd093a3e7ccec318fd.tar.bz2 | |
Merge pull request #2226 from mhenwood/amend_viewset_docs
Amend ViewSet docs to warn of potential problem
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/viewsets.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md index 28186c64..3e37cef8 100644 --- a/docs/api-guide/viewsets.md +++ b/docs/api-guide/viewsets.md @@ -201,6 +201,8 @@ Note that you can use any of the standard attributes or method overrides provide def get_queryset(self): return self.request.user.accounts.all() +Note however that upon removal of the `queryset` property from your `ViewSet`, any associated [router][routers] will be unable to derive the base_name of your Model automatically, and so you you will have to specify the `base_name` kwarg as part of your [router registration][routers]. + Also note that although this class provides the complete set of create/list/retrieve/update/destroy actions by default, you can restrict the available operations by using the standard permission classes. ## ReadOnlyModelViewSet @@ -243,3 +245,4 @@ To create a base viewset class that provides `create`, `list` and `retrieve` ope By creating your own base `ViewSet` classes, you can provide common behavior that can be reused in multiple viewsets across your API. [cite]: http://guides.rubyonrails.org/routing.html +[routers]: routers.md |
