diff options
| author | Tom Christie | 2012-08-29 20:57:37 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-08-29 20:57:37 +0100 |
| commit | 578017e01d1da4746ae0045268043cfd74d41b42 (patch) | |
| tree | d729eb93484247fa44b509a4b693811e6978a190 /docs/views.md | |
| parent | 21f59162db37c656b4f025cdd8e13cdb9933a4fc (diff) | |
| download | django-rest-framework-578017e01d1da4746ae0045268043cfd74d41b42.tar.bz2 | |
New docs
Diffstat (limited to 'docs/views.md')
| -rw-r--r-- | docs/views.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/views.md b/docs/views.md new file mode 100644 index 00000000..d227339e --- /dev/null +++ b/docs/views.md @@ -0,0 +1,43 @@ +Views +===== + +REST framework provides a simple `View` class, built on Django's `django.generics.views.View`. The `View` class ensures five main things: + +1. Any requests inside the view will become `Request` instances. +2. `Request` instances will have their `renderers` and `authentication` attributes automatically set. +3. `Response` instances will have their `parsers` and `serializer` attributes automatically set. +4. `ImmediateResponse` exceptions will be caught and returned as regular responses. +5. Any permissions provided will be checked prior to passing the request to a handler method. + +Additionally there are a some minor extras, such as providing a default `options` handler, setting some common headers on the response prior to return, and providing the useful `initial()` and `final()` hooks. + +View +---- + +.get(), .post(), .put(), .delete() etc... +----------------------------------------- + +.initial(request, *args, **kwargs) +---------------------------------- + +.final(request, response, *args, **kwargs) +------------------------------------------ + +.parsers +-------- + +.renderers +---------- + +.serializer +----------- + +.authentication +--------------- + +.permissions +------------ + +.headers +-------- + |
