diff options
| author | Tom Christie | 2013-08-23 16:16:41 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-08-23 16:16:41 +0100 |
| commit | e23d5888522f98c30418452c0f833cf11589e0c1 (patch) | |
| tree | 51bbf9b44fa35d8cb448e2a0ad86a214688ed0be | |
| parent | 10d386ec6a4822402b5ffea46bdd9e7d72db519b (diff) | |
| download | django-rest-framework-e23d5888522f98c30418452c0f833cf11589e0c1.tar.bz2 | |
Adding standard renderer attributes and documenting
| -rw-r--r-- | rest_framework/renderers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index a8670546..9885c8dd 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -317,7 +317,18 @@ class StaticHTMLRenderer(TemplateHTMLRenderer): class HTMLFormRenderer(BaseRenderer): + """ + Renderers serializer data into an HTML form. + + If the serializer was instantiated without an object then this will + return an HTML form not bound to any object, + otherwise it will return an HTML form with the appropriate initial data + populated from the object. + """ + media_type = 'text/html' + format = 'form' template = 'rest_framework/form.html' + charset = 'utf-8' def data_to_form_fields(self, data): fields = {} |
