diff options
| author | Tom Christie | 2012-10-17 22:39:07 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-10-17 22:39:07 +0100 |
| commit | fb56f215ae50da0aebe99e05036ece259fd3e6f1 (patch) | |
| tree | 1566a18e4b4ad03a094c2c630b57d1530a9245d7 /rest_framework/renderers.py | |
| parent | 4231995fbd80e45991975ab81d9e570a9f4b72d0 (diff) | |
| download | django-rest-framework-fb56f215ae50da0aebe99e05036ece259fd3e6f1.tar.bz2 | |
Added `media_type` to `.parse()` - Consistency with renderer API.
Diffstat (limited to 'rest_framework/renderers.py')
| -rw-r--r-- | rest_framework/renderers.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 94d253c9..23fd961b 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -1,9 +1,10 @@ """ -Renderers are used to serialize a View's output into specific media types. +Renderers are used to serialize a response into specific media types. -Django REST framework also provides HTML and PlainText renderers that help self-document the API, -by serializing the output along with documentation regarding the View, output status and headers, -and providing forms and links depending on the allowed methods, renderers and parsers on the View. +They give us a generic way of being able to handle various media types +on the response, such as JSON encoded data or HTML output. + +REST framework also provides an HTML renderer the renders the browseable API. """ import string from django import forms @@ -23,8 +24,8 @@ from rest_framework import serializers, parsers class BaseRenderer(object): """ - All renderers must extend this class, set the :attr:`media_type` attribute, - and override the :meth:`render` method. + All renderers should extend this class, setting the `media_type` + and `format` attributes, and override the `.render()` method. """ media_type = None |
