Commit d75cebf7 by Tom Christie

Remove router bit from viewset docs

parent e0020c5b
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
# ViewSets # ViewSets
> 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.
>
> — [Ruby on Rails Documentation][cite]
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'. 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'.
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()`. 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 ...@@ -128,18 +133,4 @@ By creating your own base `ViewSet` classes, you can provide common behavior tha
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. 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.
---
# Routers
Routers provide a convenient and simple shortcut for wiring up your application's URLs.
router = routers.DefaultRouter()
router.register('^/', APIRoot, 'api-root')
router.register('^users/', UserViewSet, 'user')
router.register('^groups/', GroupViewSet, 'group')
router.register('^accounts/', AccountViewSet, 'account')
urlpatterns = router.urlpatterns
[cite]: http://guides.rubyonrails.org/routing.html [cite]: http://guides.rubyonrails.org/routing.html
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment