8000 Remove router bit from viewset docs · dhepper/django-rest-framework@d75cebf · GitHub
[go: up one dir, main page]

Skip to content

Commit d75cebf

Browse files
committed
Remove router bit from viewset docs
1 parent e0020c5 commit d75cebf

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

docs/api-guide/viewsets.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# ViewSets
44

5+
> After routing has determined which controller to use for a request, your controller is responsible for making sense of the request and producing the appropriate output.
6+
>
7+
> — [Ruby on Rails Documentation][cite]
8+
9+
510
Django REST framework allows you to combine the logic for a set of related views in a single class, called a `ViewSet`. In other frameworks you may also find conceptually similar implementations named something like 'Resources' or 'Controllers'.
611

712
A `ViewSet` class is simply **a type of class-based View, that does not provide any method handlers** such as `.get()` or `.post()`, and instead provides actions such as `.list()` and `.create()`.
@@ -128,18 +133,4 @@ By creating your own base `ViewSet` classes, you can provide common behavior tha
128133

129134
For advanced usage, it's worth noting the that `ViewSetMixin` class can also be applied to the standard Django `View` class. Doing so allows you to use REST framework's automatic routing, but don't want to use it's permissions, authentication and other API policies.
130135

131-
---
132-
133-
# Routers
134-
135-
Routers provide a convenient and simple shortcut for wiring up your application's URLs.
136-
137-
router = routers.DefaultRouter()
138-
router.register('^/', APIRoot, 'api-root')
139-
router.register('^users/', UserViewSet, 'user')
140-
router.register('^groups/', GroupViewSet, 'group')
141-
router.register('^accounts/', AccountViewSet, 'account')
142-
143-
urlpatterns = router.urlpatterns
144-
145136
[cite]: http://guides.rubyonrails.org/routing.html

0 commit comments

Comments
 (0)
0