From 2052b508eb92c62fc0678efd4936c5ec1e0e735b Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Sun, 26 Aug 2007 01:10:53 +0000 Subject: gis: Made necessary modifications for unicode, manage refactor, backend refactor and merged 5584-6000 via svnmerge from [repos:django/trunk trunk]. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6018 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/templates_python.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs/templates_python.txt') diff --git a/docs/templates_python.txt b/docs/templates_python.txt index 7171f32612..261eaedf74 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -277,7 +277,7 @@ Subclassing Context: RequestContext Django comes with a special ``Context`` class, ``django.template.RequestContext``, that acts slightly differently than -the normal ``django.template.Context``. The first difference is that takes +the normal ``django.template.Context``. The first difference is that it takes an `HttpRequest object`_ as its first argument. For example:: c = RequestContext(request, { @@ -311,9 +311,10 @@ optional, third positional argument, ``processors``. In this example, the def some_view(request): # ... - return RequestContext(request, { + c = RequestContext(request, { 'foo': 'bar', }, [ip_address_processor]) + return t.render(c) Note:: If you're using Django's ``render_to_response()`` shortcut to populate a @@ -673,11 +674,11 @@ If you are writing a template filter which only expects a string as the first argument, you should use the included decorator ``stringfilter`` which will convert an object to it's string value before being passed to your function:: - from django import template + from django.template.defaultfilters import stringfilter - @template.stringfilter + @stringfilter def lower(value): - return value.lower() + return value.lower() Writing custom template tags ---------------------------- -- cgit v1.3