diff options
| author | Robin Munn <robin.munn@gmail.com> | 2006-09-05 15:51:14 +0000 |
|---|---|---|
| committer | Robin Munn <robin.munn@gmail.com> | 2006-09-05 15:51:14 +0000 |
| commit | 70e05817910d5fe757a3a235252ef7c12e058676 (patch) | |
| tree | 98583716fe36100c8b9e82e31325993d3b4f382b /docs/templates_python.txt | |
| parent | 083ebb346844ece29d81bacdd5ec6574feae3896 (diff) | |
sqlalchemy: Merged revisions 3679 to 3723 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/sqlalchemy@3724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/templates_python.txt')
| -rw-r--r-- | docs/templates_python.txt | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt index 8da589a125..950b122339 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -198,9 +198,19 @@ some things to keep in mind: How invalid variables are handled ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If a variable doesn't exist, the template system inserts the value of the -``TEMPLATE_STRING_IF_INVALID`` setting, which is set to ``''`` (the empty -string) by default. +Generally, if a variable doesn't exist, the template system inserts the +value of the ``TEMPLATE_STRING_IF_INVALID`` setting, which is set to ``''`` +(the empty string) by default. + +Filters that are applied to an invalid variable will only be applied if +``TEMPLATE_STRING_IF_INVALID`` is set to ``''`` (the empty string). If +``TEMPLATE_STRING_IF_INVALID`` is set to any other value, variable +filters will be ignored. + +This behavior is slightly different for the ``if``, ``for`` and ``regroup`` +template tags. If an invalid variable is provided to one of these template +tags, the variable will be interpreted as ``None``. Filters are always +applied to invalid variables within these template tags. Playing with Context objects ---------------------------- @@ -300,19 +310,22 @@ If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every * ``user`` -- An ``auth.User`` instance representing the currently logged-in user (or an ``AnonymousUser`` instance, if the client isn't logged in). See the `user authentication docs`. - - * ``messages`` -- Returns a list of messages for the currently logged-in - user (set with ``user.add_message()``). Behind the scenes, this calls - ``request.user.get_and_delete_messages()``, which iterates over user's - messages and returns the actual message before deleting the ``Message`` - object. - + + * ``messages`` -- A list of messages (as strings) for the currently + logged-in user. Behind the scenes, this calls + ``request.user.get_and_delete_messages()`` for every request. That method + collects the user's messages and deletes them from the database. + + Note that messages are set with ``user.add_message()``. See the + `message docs`_ for more. + * ``perms`` -- An instance of ``django.core.context_processors.PermWrapper``, representing the permissions that the currently logged-in user has. See the `permissions docs`_. .. _user authentication docs: http://www.djangoproject.com/documentation/authentication/#users +.. _message docs: http://www.djangoproject.com/documentation/authentication/#messages .. _permissions docs: http://www.djangoproject.com/documentation/authentication/#permissions django.core.context_processors.debug |
