Skip to content

Commit 9879a5d

Browse files
committed
Merge pull request #2226 from mhenwood/amend_viewset_docs
Amend ViewSet docs to warn of potential problem
2 parents 8553858 + 9b468fb commit 9879a5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/api-guide/viewsets.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ Note that you can use any of the standard attributes or method overrides provide
201201
def get_queryset(self):
202202
return self.request.user.accounts.all()
203203

204+
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].
205+
204206
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.
205207

206208
## ReadOnlyModelViewSet
@@ -243,3 +245,4 @@ To create a base viewset class that provides `create`, `list` and `retrieve` ope
243245
By creating your own base `ViewSet` classes, you can provide common behavior that can be reused in multiple viewsets across your API.
244246

245247
[cite]: http://guides.rubyonrails.org/routing.html
248+
[routers]: routers.md

0 commit comments

Comments
 (0)