diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-27 16:43:56 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-27 16:43:56 +0000 |
| commit | 2fb95f1de699fbc3c39ac83dbf5fabb63af96642 (patch) | |
| tree | 36dbf962d03912b2620d5a5ad3b4e4d1eb83b703 /docs/templates_python.txt | |
| parent | 2564f34c2b0a9ef70bf7079ff157a6d2c90fe3d8 (diff) | |
Changed template library system so that it looks for a module-level variable named 'register' rather than the first instance of template.Library it finds
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1461 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/templates_python.txt')
| -rw-r--r-- | docs/templates_python.txt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt index 904844fa25..de212cd141 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -443,14 +443,13 @@ 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 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 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.core import template - register = template.Library() -Convention is to call this instance ``register``. + register = template.Library() .. admonition:: Behind the scenes |
