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
439b364e
Kaydet (Commit)
439b364e
authored
Ara 18, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added an _-prefix to pending lookups because it's transient.
üst
86804ab0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
cache.py
django/core/apps/cache.py
+3
-3
related.py
django/db/models/fields/related.py
+2
-2
No files found.
django/core/apps/cache.py
Dosyayı görüntüle @
439b364e
...
...
@@ -43,9 +43,6 @@ class AppCache(object):
# Mapping of labels to AppConfig instances for installed apps.
self
.
app_configs
=
OrderedDict
()
# Pending lookups for lazy relations
self
.
pending_lookups
=
{}
# Set of app names. Allows restricting the set of installed apps.
# Used by TransactionTestCase.available_apps for performance reasons.
self
.
available_apps
=
None
...
...
@@ -54,6 +51,9 @@ class AppCache(object):
self
.
_apps_loaded
=
not
self
.
master
self
.
_models_loaded
=
not
self
.
master
# Pending lookups for lazy relations.
self
.
_pending_lookups
=
{}
# Cache for get_models.
self
.
_get_models_cache
=
{}
...
...
django/db/models/fields/related.py
Dosyayı görüntüle @
439b364e
...
...
@@ -74,7 +74,7 @@ def add_lazy_relation(cls, field, relation, operation):
else
:
key
=
(
app_label
,
model_name
)
value
=
(
cls
,
field
,
operation
)
cls
.
_meta
.
app_cache
.
pending_lookups
.
setdefault
(
key
,
[])
.
append
(
value
)
cls
.
_meta
.
app_cache
.
_
pending_lookups
.
setdefault
(
key
,
[])
.
append
(
value
)
def
do_pending_lookups
(
sender
,
**
kwargs
):
...
...
@@ -82,7 +82,7 @@ def do_pending_lookups(sender, **kwargs):
Handle any pending relations to the sending model. Sent from class_prepared.
"""
key
=
(
sender
.
_meta
.
app_label
,
sender
.
__name__
)
for
cls
,
field
,
operation
in
sender
.
_meta
.
app_cache
.
pending_lookups
.
pop
(
key
,
[]):
for
cls
,
field
,
operation
in
sender
.
_meta
.
app_cache
.
_
pending_lookups
.
pop
(
key
,
[]):
operation
(
field
,
sender
,
cls
)
signals
.
class_prepared
.
connect
(
do_pending_lookups
)
...
...
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