summaryrefslogtreecommitdiff
path: root/docs/templates_python.txt
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2008-03-13 06:14:26 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2008-03-13 06:14:26 +0000
commitbfc5660c472ac2e52cc4fdec78315c87b01357de (patch)
tree887c25472201f310cc5b95cb236cf5492af9bf57 /docs/templates_python.txt
parent304642769c5e0e704d0204bc241574c8c491cdf5 (diff)
newforms-admin: Merged from trunk up to [7232]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/templates_python.txt')
-rw-r--r--docs/templates_python.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt
index f98cfa3249..43ef016ed4 100644
--- a/docs/templates_python.txt
+++ b/docs/templates_python.txt
@@ -395,6 +395,8 @@ See the `internationalization docs`_ for more.
django.core.context_processors.media
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**New in Django development version**
+
If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every
``RequestContext`` will contain a variable ``MEDIA_URL``, providing the
value of the `MEDIA_URL setting`_.
@@ -627,9 +629,10 @@ the given Python module name, not the name of the app.
Once you've created that Python module, you'll just have to write a bit of
Python code, depending on whether you're writing filters or tags.
-To be a valid tag library, the module contain a module-level variable named
-``register`` that is a ``template.Library`` instance, in which all the tags and
-filters are registered. So, near the top of your module, put the following::
+To be a valid tag library, the module must contain a module-level variable
+named ``register`` that is a ``template.Library`` instance, in which all the
+tags and filters are registered. So, near the top of your module, put the
+following::
from django import template
@@ -981,7 +984,7 @@ Notes:
exception. It should fail silently, just as template filters should.
Ultimately, this decoupling of compilation and rendering results in an
-efficient template system, because a template can render multiple context
+efficient template system, because a template can render multiple contexts
without having to be parsed multiple times.
Auto-escaping considerations
@@ -1014,7 +1017,7 @@ This is not a very common situation, but it's useful if you're rendering a
template yourself. For example::
def render(self, context):
- t = template.load_template('small_fragment.html')
+ t = template.loader.get_template('small_fragment.html')
return t.render(Context({'var': obj}, autoescape=context.autoescape))
If we had neglected to pass in the current ``context.autoescape`` value to our