diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-10 20:49:45 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-04-10 20:49:45 +0000 |
| commit | 93240b7d903af86e135c3b1724a81d2daf31441f (patch) | |
| tree | 1f890c3fd6d7e7c19449dd2414ddadbe8e8d86df /docs/ref | |
| parent | 28e5b665189548557993b522e3bd7adeed3f62ea (diff) | |
Fixed #17229 -- Allow 'True', 'False' and 'None' to resolve to the corresponding Python objects in templates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/api.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 03fef1da45..605f0a5698 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -111,6 +111,9 @@ template:: >>> t.render(c) "My name is Dolores." +Variables and lookups +~~~~~~~~~~~~~~~~~~~~~ + Variable names must consist of any letter (A-Z), any digit (0-9), an underscore (but they must not start with an underscore) or a dot. @@ -225,7 +228,6 @@ straight lookups. Here are some things to keep in mind: if your variable is not callable (allowing you to access attributes of the callable, for example). - .. _invalid-template-variables: How invalid variables are handled @@ -263,6 +265,16 @@ be replaced with the name of the invalid variable. in order to debug a specific template problem, then cleared once debugging is complete. +Builtin variables +~~~~~~~~~~~~~~~~~ + +Every context contains ``True``, ``False`` and ``None``. As you would expect, +these variables resolve to the corresponding Python objects. + +.. versionadded:: 1.5 + Before Django 1.5, these variables weren't a special case, and they + resolved to ``None`` unless you defined them in the context. + Playing with Context objects ---------------------------- |
