1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #16744 -- Class based view should have the view object in the context

Updated the most recent patch from @claudep to apply again and updated
the documentation location.
This commit is contained in:
Marc Tamlyn
2012-08-18 14:46:17 +01:00
committed by Andrew Godwin
parent 547b181046
commit 58683e9c82
8 changed files with 35 additions and 2 deletions

View File

@@ -17,8 +17,20 @@ ContextMixin
.. method:: get_context_data(**kwargs)
Returns a dictionary representing the template context. The
keyword arguments provided will make up the returned context.
Returns a dictionary representing the template context. The keyword
arguments provided will make up the returned context.
The template context of all class-based generic views include a
``view`` variable that points to the ``View`` instance.
.. admonition:: Use ``alters_data`` where appropriate
Note that having the view instance in the template context may
expose potentially hazardous methods to template authors. To
prevent methods like this from being called in the template, set
``alters_data=True`` on those methods. For more information, read
the documentation on :ref:`rendering a template context
<alters-data-description>`.
TemplateResponseMixin
---------------------