Code

Ticket #13841: 13841-docs.diff

File 13841-docs.diff, 1.1 KB (added by simon29, 3 years ago)

Updated docs.

Line 
1Index: ref/templates/api.txt
2===================================================================
3--- ref/templates/api.txt       (revision 15560)
4+++ ref/templates/api.txt       (working copy)
5@@ -516,10 +516,15 @@
6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 
8 A context processor has a very simple interface: It's just a Python function
9-that takes one argument, an :class:`~django.http.HttpRequest` object, and
10-returns a dictionary that gets added to the template context. Each context
11-processor *must* return a dictionary.
12+that takes at least one argument, an :class:`~django.http.HttpRequest` object.
13 
14+.. versionadded:: 1.2
15+   The optional keyword argument ``context`` is now supported, which allows
16+   access to the current :class:`~django.template.Context` object.
17+
18+The function returns a dictionary that gets added to the template context.
19+Each context processor *must* return a dictionary.
20+
21 Custom context processors can live anywhere in your code base. All Django cares
22 about is that your custom context processors are pointed-to by your
23 :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting.