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
5d5e1f5a
Kaydet (Commit)
5d5e1f5a
authored
Ara 24, 2012
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed support is_safe and needs_autoescape as function attributes.
üst
641acf76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
29 deletions
+0
-29
defaultfilters.py
django/template/defaultfilters.py
+0
-9
custom-template-tags.txt
docs/howto/custom-template-tags.txt
+0
-20
No files found.
django/template/defaultfilters.py
Dosyayı görüntüle @
5d5e1f5a
...
...
@@ -49,15 +49,6 @@ def stringfilter(func):
# when multiple decorators are applied).
_dec
.
_decorated_function
=
getattr
(
func
,
'_decorated_function'
,
func
)
for
attr
in
(
'is_safe'
,
'needs_autoescape'
):
if
hasattr
(
func
,
attr
):
import
warnings
warnings
.
warn
(
"Setting the
%
s attribute of a template filter "
"function is deprecated; use @register.filter(
%
s=
%
s) "
"instead"
%
(
attr
,
attr
,
getattr
(
func
,
attr
)),
DeprecationWarning
)
setattr
(
_dec
,
attr
,
getattr
(
func
,
attr
))
return
wraps
(
func
)(
_dec
)
...
...
docs/howto/custom-template-tags.txt
Dosyayı görüntüle @
5d5e1f5a
...
...
@@ -328,26 +328,6 @@ Template filter code falls into one of two situations:
handle the auto-escaping issues and return a safe string, the
``is_safe`` flag won't change anything either way.
.. versionchanged:: 1.4
``is_safe`` and ``needs_autoescape`` used to be attributes of the filter
function; this syntax is deprecated.
.. code-block:: python
@register.filter
def myfilter(value):
return value
myfilter.is_safe = True
.. code-block:: python
@register.filter
def initial_letter_filter(text, autoescape=None):
# ...
return mark_safe(result)
initial_letter_filter.needs_autoescape = True
.. _filters-timezones:
Filters and time zones
...
...
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