~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/ref/templates/builtins.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.2.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-9lnsrh0i3mxozbt0
Tags: upstream-1.2.3
ImportĀ upstreamĀ versionĀ 1.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _ref-templates-builtins:
2
 
 
3
1
==================================
4
2
Built-in template tags and filters
5
3
==================================
25
23
 
26
24
Control the current auto-escaping behavior. This tag takes either ``on`` or
27
25
``off`` as an argument and that determines whether auto-escaping is in effect
28
 
inside the block.
 
26
inside the block. The block is closed with an ``endautoescape`` ending tag.
29
27
 
30
28
When auto-escaping is in effect, all variable content has HTML escaping applied
31
29
to it before placing the result into the output (but after any filters have
36
34
escaping, either by the code that populated the variable, or because it has had
37
35
the ``safe`` or ``escape`` filters applied.
38
36
 
 
37
Sample usage::
 
38
 
 
39
    {% autoescape on %}
 
40
        {{ body }}
 
41
    {% endautoescape %}
 
42
 
39
43
.. templatetag:: block
40
44
 
41
45
block
60
64
 
61
65
In the Django 1.1.X series, this is a no-op tag that returns an empty string for
62
66
future compatibility purposes.  In Django 1.2 and later, it is used for CSRF
63
 
protection, as described in the documentation for :ref:`Cross Site Request
64
 
Forgeries <ref-contrib-csrf>`.
 
67
protection, as described in the documentation for :doc:`Cross Site Request
 
68
Forgeries </ref/contrib/csrf>`.
65
69
 
66
70
.. templatetag:: cycle
67
71
 
633
637
 
634
638
Load a custom template tag set.
635
639
 
636
 
See :ref:`Custom tag and filter libraries <howto-custom-template-tags>` for more information.
 
640
See :doc:`Custom tag and filter libraries </howto/custom-template-tags>` for more information.
637
641
 
638
642
.. templatetag:: now
639
643
 
1883
1887
 
1884
1888
If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel is ..."``.
1885
1889
 
 
1890
Newlines within the string will be removed.
 
1891
 
1886
1892
.. templatefilter:: truncatewords_html
1887
1893
 
1888
1894
truncatewords_html
1902
1908
If ``value`` is ``"<p>Joel is a slug</p>"``, the output will be
1903
1909
``"<p>Joel is ...</p>"``.
1904
1910
 
 
1911
Newlines in the HTML content will be preserved.
 
1912
 
1905
1913
.. templatefilter:: unordered_list
1906
1914
 
1907
1915
unordered_list
2058
2066
~~~~~~~~~~~~~~~~~~~~~~~
2059
2067
 
2060
2068
A set of Django template filters useful for adding a "human touch" to data. See
2061
 
:ref:`ref-contrib-humanize`.
 
2069
:doc:`/ref/contrib/humanize`.
2062
2070
 
2063
2071
django.contrib.markup
2064
2072
~~~~~~~~~~~~~~~~~~~~~
2069
2077
    * Markdown
2070
2078
    * ReST (ReStructured Text)
2071
2079
 
2072
 
See :ref:`ref-contrib-markup`.
 
2080
See the :doc:`markup documentation </ref/contrib/markup>`.
2073
2081
 
2074
2082
django.contrib.webdesign
2075
2083
~~~~~~~~~~~~~~~~~~~~~~~~
2076
2084
 
2077
2085
A collection of template tags that can be useful while designing a website,
2078
 
such as a generator of Lorem Ipsum text. See :ref:`ref-contrib-webdesign`.
 
2086
such as a generator of Lorem Ipsum text. See :doc:`/ref/contrib/webdesign`.
2079
2087
 
2080
2088
i18n
2081
2089
~~~~