diff options
| author | Tim Graham <timograham@gmail.com> | 2017-10-24 13:25:55 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-10-25 12:46:12 -0400 |
| commit | 171c7cc863eafc2346aa84ffd1d540644539f1a4 (patch) | |
| tree | cff1f61503593b19f6241272eb30035c6e62abfd /docs | |
| parent | 3642c3758b3426292e02fe4669cc2d2028a9ac8c (diff) | |
Fixed #28737 -- Clarified {% cache %} tag's handling of arguments.
Thanks Tom Aratyn for the report.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/cache.txt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 927e035c90..7c72075817 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -660,8 +660,9 @@ example: Sometimes you might want to cache multiple copies of a fragment depending on some dynamic data that appears inside the fragment. For example, you might want a separate cached copy of the sidebar used in the previous example for every user -of your site. Do this by passing additional arguments to the ``{% cache %}`` -template tag to uniquely identify the cache fragment: +of your site. Do this by passing one or more additional arguments, which may be +variables with or without filters, to the ``{% cache %}`` template tag to +uniquely identify the cache fragment: .. code-block:: html+django @@ -670,9 +671,6 @@ template tag to uniquely identify the cache fragment: .. sidebar for logged in user .. {% endcache %} -It's perfectly fine to specify more than one argument to identify the fragment. -Simply pass as many arguments to ``{% cache %}`` as you need. - If :setting:`USE_I18N` is set to ``True`` the per-site middleware cache will :ref:`respect the active language<i18n-cache-key>`. For the ``cache`` template tag you could use one of the |
