Rendering Helper¶
-
class
cwf.views.rendering.
Renderer
[source]¶ Stateless class that simplifies usage of Django machinary for creating HttpResponse objects
An instantiated instance of this class is provided from
cwf.views.rendering.renderer
-
json
(data)[source]¶ Return HttpResponse object with data dumped as a json string and a ‘application/javascript’ content_type
-
render
(request, template, extra=None, mime='text/html', modify=None)[source]¶ Create a template, give it context and display as some mime type
Using a RequestContext object provided by
self.request_context
If modify is provided and is callable then it will be used to modify the rendered template before creating the HttpResponse object
-
request_context
(request, extra)[source]¶ Create a RequestContext object from the request and extra context provided.
If request has a
state
member, that will be used as default context , otherwise an empty dictionary is used, which is updated with theextra
context provided.
-