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
74d4d58b
Kaydet (Commit)
74d4d58b
authored
Şub 16, 2014
tarafından
Zbigniew Siciarz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21939 -- Deprecated loading ssi/url tags from future.
üst
653527de
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
17 deletions
+25
-17
future.py
django/templatetags/future.py
+10
-2
deprecation.txt
docs/internals/deprecation.txt
+3
-3
tutorial03.txt
docs/intro/tutorial03.txt
+0
-11
1.7.txt
docs/releases/1.7.txt
+9
-0
tests.py
tests/template_tests/tests.py
+3
-1
No files found.
django/templatetags/future.py
Dosyayı görüntüle @
74d4d58b
import
warnings
from
django.template
import
Library
from
django.template
import
defaulttags
...
...
@@ -6,13 +8,19 @@ register = Library()
@register.tag
def
ssi
(
parser
,
token
):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
warnings
.
warn
(
"Loading the `ssi` tag from the `future` library is deprecated and "
"will be removed in Django 1.9. Use the default `ssi` tag instead."
,
PendingDeprecationWarning
)
return
defaulttags
.
ssi
(
parser
,
token
)
@register.tag
def
url
(
parser
,
token
):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
warnings
.
warn
(
"Loading the `url` tag from the `future` library is deprecated and "
"will be removed in Django 1.9. Use the default `url` tag instead."
,
PendingDeprecationWarning
)
return
defaulttags
.
url
(
parser
,
token
)
...
...
docs/internals/deprecation.txt
Dosyayı görüntüle @
74d4d58b
...
...
@@ -12,9 +12,6 @@ about each item can often be found in the release notes of two versions prior.
2.0
---
* ``ssi`` and ``url`` template tags will be removed from the ``future`` template
tag library (used during the 1.3/1.4 deprecation period).
.. _deprecation-removed-in-1.9:
1.9
...
...
@@ -119,6 +116,9 @@ details on these changes.
* ``django.utils.module_loading.import_by_path`` will be removed in favor of
``django.utils.module_loading.import_string``.
* ``ssi`` and ``url`` template tags will be removed from the ``future`` template
tag library (used during the 1.3/1.4 deprecation period).
.. _deprecation-removed-in-1.8:
1.8
...
...
docs/intro/tutorial03.txt
Dosyayı görüntüle @
74d4d58b
...
...
@@ -548,17 +548,6 @@ defined in your url configurations by using the ``{% url %}`` template tag:
<li><a href="{% url 'detail' question.id %}">{{ question.question_text }}</a></li>
.. note::
If ``{% url 'detail' question.id %}`` (with quotes) doesn't work, but
``{% url detail question.id %}`` (without quotes) does, that means you're
using a version of Django < 1.5. In this case, add the following
declaration at the top of your template:
.. code-block:: html+django
{% load url from future %}
The way this works is by looking up the URL definition as specified in the
``polls.urls`` module. You can see exactly where the URL name of 'detail' is
defined below::
...
...
docs/releases/1.7.txt
Dosyayı görüntüle @
74d4d58b
...
...
@@ -1337,3 +1337,12 @@ The functionality required by ``check_field()`` is the same as that provided
by ``validate_field()``, but the output format is different. Third-party database
backends needing this functionality should modify their backends to provide an
implementation of ``check_field()``.
Loading ``ssi`` and ``url`` template tags from ``future`` library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Django 1.3 introduced ``{% load ssi from future %}`` and
``{% load url from future %}`` syntax for forward compatibility of the
:ttag:`ssi` and :ttag:`url` template tags. This syntax is now deprecated and
will be removed in Django 1.9. You can simply remove the
``{% load ... from future %}`` tags.
tests/template_tests/tests.py
Dosyayı görüntüle @
74d4d58b
...
...
@@ -612,8 +612,10 @@ class TemplateTests(TestCase):
try
:
try
:
with
warnings
.
catch_warnings
():
# Ignore
pending
deprecations of the old syntax of the 'cycle' and 'firstof' tags.
# Ignore deprecations of the old syntax of the 'cycle' and 'firstof' tags.
warnings
.
filterwarnings
(
"ignore"
,
category
=
DeprecationWarning
,
module
=
'django.template.base'
)
# Ignore pending deprecations of loading 'ssi' and 'url' tags from future.
warnings
.
filterwarnings
(
"ignore"
,
category
=
PendingDeprecationWarning
,
module
=
'django.templatetags.future'
)
test_template
=
loader
.
get_template
(
name
)
except
ShouldNotExecuteException
:
failures
.
append
(
"Template test (Cached='
%
s', TEMPLATE_STRING_IF_INVALID='
%
s', TEMPLATE_DEBUG=
%
s):
%
s -- FAILED. Template loading invoked method that shouldn't have been invoked."
%
(
is_cached
,
invalid_str
,
template_debug
,
name
))
...
...
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