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
c47f8a9d
Kaydet (Commit)
c47f8a9d
authored
Eyl 26, 2016
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Eyl 26, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed obsolete lines in DeferredAttribute.__get__().
Obsolete as of
c21e86ab
.
üst
85f2bba7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
query_utils.py
django/db/models/query_utils.py
+1
-10
No files found.
django/db/models/query_utils.py
Dosyayı görüntüle @
c47f8a9d
...
@@ -10,7 +10,6 @@ from __future__ import unicode_literals
...
@@ -10,7 +10,6 @@ from __future__ import unicode_literals
import
inspect
import
inspect
from
collections
import
namedtuple
from
collections
import
namedtuple
from
django.core.exceptions
import
FieldDoesNotExist
from
django.db.models.constants
import
LOOKUP_SEP
from
django.db.models.constants
import
LOOKUP_SEP
from
django.utils
import
tree
from
django.utils
import
tree
from
django.utils.lru_cache
import
lru_cache
from
django.utils.lru_cache
import
lru_cache
...
@@ -108,19 +107,11 @@ class DeferredAttribute(object):
...
@@ -108,19 +107,11 @@ class DeferredAttribute(object):
"""
"""
if
instance
is
None
:
if
instance
is
None
:
return
self
return
self
opts
=
instance
.
_meta
data
=
instance
.
__dict__
data
=
instance
.
__dict__
if
data
.
get
(
self
.
field_name
,
self
)
is
self
:
if
data
.
get
(
self
.
field_name
,
self
)
is
self
:
# self.field_name is the attname of the field, but only() takes the
# actual name, so we need to translate it here.
try
:
f
=
opts
.
get_field
(
self
.
field_name
)
except
FieldDoesNotExist
:
f
=
[
f
for
f
in
opts
.
fields
if
f
.
attname
==
self
.
field_name
][
0
]
name
=
f
.
name
# Let's see if the field is part of the parent chain. If so we
# Let's see if the field is part of the parent chain. If so we
# might be able to reuse the already loaded value. Refs #18343.
# might be able to reuse the already loaded value. Refs #18343.
val
=
self
.
_check_parent_chain
(
instance
,
name
)
val
=
self
.
_check_parent_chain
(
instance
,
self
.
field_
name
)
if
val
is
None
:
if
val
is
None
:
instance
.
refresh_from_db
(
fields
=
[
self
.
field_name
])
instance
.
refresh_from_db
(
fields
=
[
self
.
field_name
])
val
=
getattr
(
instance
,
self
.
field_name
)
val
=
getattr
(
instance
,
self
.
field_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