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
9d304b26
Kaydet (Commit)
9d304b26
authored
Ara 31, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #20223 -- Removed deprecated django.utils.functional.allow_lazy().
üst
7e63e845
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
31 deletions
+3
-31
functional.py
django/utils/functional.py
+0
-10
utils.txt
docs/ref/utils.txt
+0
-7
2.0.txt
docs/releases/2.0.txt
+2
-0
tests.py
tests/decorators/tests.py
+1
-14
No files found.
django/utils/functional.py
Dosyayı görüntüle @
9d304b26
import
copy
import
operator
import
warnings
from
functools
import
total_ordering
,
wraps
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInDjango20Warning
# You can't trivially replace this with `functools.partial` because this binds
...
...
@@ -189,14 +187,6 @@ def lazystr(text):
return
lazy
(
force_text
,
six
.
text_type
)(
text
)
def
allow_lazy
(
func
,
*
resultclasses
):
warnings
.
warn
(
"django.utils.functional.allow_lazy() is deprecated in favor of "
"django.utils.functional.keep_lazy()"
,
RemovedInDjango20Warning
,
2
)
return
keep_lazy
(
*
resultclasses
)(
func
)
def
keep_lazy
(
*
resultclasses
):
"""
A decorator that allows a function to be called with one or more lazy
...
...
docs/ref/utils.txt
Dosyayı görüntüle @
9d304b26
...
...
@@ -518,13 +518,6 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004
z = person.friends # does not call
x is z # is True
.. function:: allow_lazy(func, *resultclasses)
.. deprecated:: 1.10
Works like :meth:`~django.utils.functional.keep_lazy` except that it can't
be used as a decorator.
.. function:: keep_lazy(func, *resultclasses)
.. versionadded:: 1.10
...
...
docs/releases/2.0.txt
Dosyayı görüntüle @
9d304b26
...
...
@@ -336,3 +336,5 @@ these features.
* The ``cascaded_union`` property of ``django.contrib.gis.geos.MultiPolygon``
is removed.
* ``django.utils.functional.allow_lazy()`` is removed.
tests/decorators/tests.py
Dosyayı görüntüle @
9d304b26
...
...
@@ -8,13 +8,9 @@ from django.contrib.auth.decorators import (
from
django.http
import
HttpRequest
,
HttpResponse
,
HttpResponseNotAllowed
from
django.middleware.clickjacking
import
XFrameOptionsMiddleware
from
django.test
import
SimpleTestCase
from
django.utils
import
six
from
django.utils.decorators
import
method_decorator
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
django.utils.encoding
import
force_text
from
django.utils.functional
import
allow_lazy
,
keep_lazy
,
keep_lazy_text
,
lazy
from
django.utils.functional
import
keep_lazy
,
keep_lazy_text
,
lazy
from
django.utils.safestring
import
mark_safe
from
django.utils.translation
import
ugettext_lazy
from
django.views.decorators.cache
import
(
cache_control
,
cache_page
,
never_cache
,
)
...
...
@@ -155,15 +151,6 @@ class DecoratorsTest(TestCase):
request
.
method
=
'DELETE'
self
.
assertIsInstance
(
my_safe_view
(
request
),
HttpResponseNotAllowed
)
def
test_deprecated_allow_lazy
(
self
):
with
self
.
assertRaises
(
RemovedInDjango20Warning
):
def
noop_text
(
text
):
return
force_text
(
text
)
noop_text
=
allow_lazy
(
noop_text
,
six
.
text_type
)
rendered
=
noop_text
(
ugettext_lazy
(
"I am a text"
))
self
.
assertEqual
(
type
(
rendered
),
six
.
text_type
)
self
.
assertEqual
(
rendered
,
"I am a text"
)
# For testing method_decorator, a decorator that assumes a single argument.
# We will get type arguments if there is a mismatch in the number of arguments.
...
...
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