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
7a75ed1a
Kaydet (Commit)
7a75ed1a
authored
Mar 03, 2015
tarafından
Alex Hill
Kaydeden (comit)
Tim Graham
Mar 25, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed untouched branch in StateApps.__init__()
üst
720ff740
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
state.py
django/db/migrations/state.py
+8
-16
No files found.
django/db/migrations/state.py
Dosyayı görüntüle @
7a75ed1a
...
...
@@ -212,22 +212,14 @@ class StateApps(Apps):
self
.
render_multiple
(
list
(
models
.
values
())
+
self
.
real_models
)
# If there are some lookups left, see if we can first resolve them
# ourselves - sometimes fields are added after a model is registered
for
lookup_model
in
self
.
_pending_operations
:
try
:
model
=
self
.
get_model
(
*
lookup_model
)
except
LookupError
:
if
lookup_model
==
make_model_tuple
(
settings
.
AUTH_USER_MODEL
)
and
ignore_swappable
:
continue
# Raise an error with a best-effort helpful message
# (only for the first issue). Error message should look like:
# "ValueError: Lookup failed for model referenced by
# field migrations.Book.author: migrations.Author"
msg
=
"Lookup failed for model: {model[0]}.{model[1]}"
raise
ValueError
(
msg
.
format
(
model
=
lookup_model
))
else
:
self
.
do_pending_operations
(
model
)
# There shouldn't be any operations pending at this point.
pending_models
=
set
(
self
.
_pending_operations
)
if
ignore_swappable
:
pending_models
-=
{
make_model_tuple
(
settings
.
AUTH_USER_MODEL
)}
if
pending_models
:
msg
=
"Unhandled pending operations for models:
%
s"
labels
=
(
"."
.
join
(
model_key
)
for
model_key
in
self
.
_pending_operations
)
raise
ValueError
(
msg
%
", "
.
join
(
labels
))
def
render_multiple
(
self
,
model_states
):
# We keep trying to render the models in a loop, ignoring invalid
...
...
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