diff options
| author | Tom Christie | 2013-04-11 15:48:41 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-04-11 15:48:41 +0100 |
| commit | d75cebf75696602170a9d282d4b114d01d6e5d8e (patch) | |
| tree | e13be4707ef80ee00279d41da5b11d7dc2e911b2 | |
| parent | e0020c5b033308cd789408a8823d6707deed8032 (diff) | |
| download | django-rest-framework-d75cebf75696602170a9d282d4b114d01d6e5d8e.tar.bz2 | |
Remove router bit from viewset docs
| -rw-r--r-- | docs/api-guide/viewsets.md | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md index 83b486dd..cf6ae33b 100644 --- a/docs/api-guide/viewsets.md +++ b/docs/api-guide/viewsets.md @@ -2,6 +2,11 @@ # 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'. 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 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
\ No newline at end of file |
