Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
1db5d882
Kaydet (Commit)
1db5d882
authored
Kas 09, 2012
tarafından
Daniel Greenfeld
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added examples for comment, templatetag, escape, force_escape, timesince, and timeuntil
üst
9942adac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
builtins.txt
docs/ref/templates/builtins.txt
+30
-2
No files found.
docs/ref/templates/builtins.txt
Dosyayı görüntüle @
1db5d882
...
...
@@ -53,6 +53,13 @@ comment
Ignores everything between ``{% comment %}`` and ``{% endcomment %}``.
Sample usage::
<p>Rendered text with {{ pub_date|date:"c" }}</p>
{% comment %}
<p>Commented out text with {{ create_date|date:"c" }}</p>
{% endcomment %}
.. templatetag:: csrf_token
csrf_token
...
...
@@ -947,6 +954,10 @@ Argument Outputs
``closecomment`` ``#}``
================== =======
Sample usage::
{% templatetag openblock %} url 'entry_list' {% templatetag closeblock %}
.. templatetag:: url
url
...
...
@@ -1409,6 +1420,12 @@ applied to the result will only result in one round of escaping being done. So
it is safe to use this function even in auto-escaping environments. If you want
multiple escaping passes to be applied, use the :tfilter:`force_escape` filter.
For example, you can apply ``escape`` to fields when :ttag:`autoescape` is off::
{% autoescape off %}
{{ title|escape }}
{% endautoescape %}
.. templatefilter:: escapejs
escapejs
...
...
@@ -1542,6 +1559,13 @@ string. This is useful in the rare cases where you need multiple escaping or
want to apply other filters to the escaped results. Normally, you want to use
the :tfilter:`escape` filter.
For example, if you want to catch the ``<paragraph>`` HTML elements created by
the :tfilter:`linebreaks` filter::
{% autoescape off %}
{{ body|linebreaks|force_escape }}
{% endautoescape %}
.. templatefilter:: get_digit
get_digit
...
...
@@ -1979,7 +2003,9 @@ Takes an optional argument that is a variable containing the date to use as
the comparison point (without the argument, the comparison point is *now*).
For example, if ``blog_date`` is a date instance representing midnight on 1
June 2006, and ``comment_date`` is a date instance for 08:00 on 1 June 2006,
then ``{{ blog_date|timesince:comment_date }}`` would return "8 hours".
then the following would return "8 hours"::
{{ blog_date|timesince:comment_date }}
Comparing offset-naive and offset-aware datetimes will return an empty string.
...
...
@@ -1998,7 +2024,9 @@ given date or datetime. For example, if today is 1 June 2006 and
Takes an optional argument that is a variable containing the date to use as
the comparison point (instead of *now*). If ``from_date`` contains 22 June
2006, then ``{{ conference_date|timeuntil:from_date }}`` will return "1 week".
2006, then the following will return "1 week"::
{{ conference_date|timeuntil:from_date }}
Comparing offset-naive and offset-aware datetimes will return an empty string.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment