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
71609a5b
Kaydet (Commit)
71609a5b
authored
Kas 30, 2016
tarafından
Adam Chainz
Kaydeden (comit)
Tim Graham
Kas 30, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27555 -- Removed django.utils.functional.lazy_property.
üst
05d2c5a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
41 deletions
+3
-41
functional.py
django/utils/functional.py
+0
-21
1.11.txt
docs/releases/1.11.txt
+2
-0
test_functional.py
tests/utils_tests/test_functional.py
+1
-20
No files found.
django/utils/functional.py
Dosyayı görüntüle @
71609a5b
...
...
@@ -412,27 +412,6 @@ class SimpleLazyObject(LazyObject):
return
copy
.
deepcopy
(
self
.
_wrapped
,
memo
)
class
lazy_property
(
property
):
"""
A property that works with subclasses by wrapping the decorated
functions of the base class.
"""
def
__new__
(
cls
,
fget
=
None
,
fset
=
None
,
fdel
=
None
,
doc
=
None
):
if
fget
is
not
None
:
@wraps
(
fget
)
def
fget
(
instance
,
instance_type
=
None
,
name
=
fget
.
__name__
):
return
getattr
(
instance
,
name
)()
if
fset
is
not
None
:
@wraps
(
fset
)
def
fset
(
instance
,
value
,
name
=
fset
.
__name__
):
return
getattr
(
instance
,
name
)(
value
)
if
fdel
is
not
None
:
@wraps
(
fdel
)
def
fdel
(
instance
,
name
=
fdel
.
__name__
):
return
getattr
(
instance
,
name
)()
return
property
(
fget
,
fset
,
fdel
,
doc
)
def
partition
(
predicate
,
values
):
"""
Splits the values into two sets, based on the return value of the function
...
...
docs/releases/1.11.txt
Dosyayı görüntüle @
71609a5b
...
...
@@ -627,6 +627,8 @@ Miscellaneous
* The unused ``BaseCommand.can_import_settings`` attribute is removed.
* The undocumented ``django.utils.functional.lazy_property`` is removed.
.. _deprecated-features-1.11:
Features deprecated in 1.11
...
...
tests/utils_tests/test_functional.py
Dosyayı görüntüle @
71609a5b
...
...
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
import
unittest
from
django.utils
import
six
from
django.utils.functional
import
cached_property
,
lazy
,
lazy_property
from
django.utils.functional
import
cached_property
,
lazy
class
FunctionalTestCase
(
unittest
.
TestCase
):
...
...
@@ -38,25 +38,6 @@ class FunctionalTestCase(unittest.TestCase):
t
=
lazy
(
lambda
:
Klazz
(),
Base
)()
self
.
assertEqual
(
t
.
method
(),
'Klazz'
)
def
test_lazy_property
(
self
):
class
A
(
object
):
def
_get_do
(
self
):
raise
NotImplementedError
def
_set_do
(
self
,
value
):
raise
NotImplementedError
do
=
lazy_property
(
_get_do
,
_set_do
)
class
B
(
A
):
def
_get_do
(
self
):
return
"DO IT"
with
self
.
assertRaises
(
NotImplementedError
):
A
()
.
do
self
.
assertEqual
(
B
()
.
do
,
'DO IT'
)
def
test_lazy_object_to_string
(
self
):
class
Klazz
(
object
):
...
...
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