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
471fb04a
Kaydet (Commit)
471fb04a
authored
Nis 20, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed flake8 errors.
üst
bbe818b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
migration.py
django/db/migrations/migration.py
+1
-0
test_autodetector.py
tests/migrations/test_autodetector.py
+2
-2
test_state.py
tests/migrations/test_state.py
+3
-0
No files found.
django/db/migrations/migration.py
Dosyayı görüntüle @
471fb04a
...
...
@@ -129,6 +129,7 @@ class Migration(object):
operation
.
database_backwards
(
self
.
app_label
,
schema_editor
,
from_state
,
to_state
)
return
project_state
def
swappable_dependency
(
value
):
"""
Turns a setting value into a dependency.
...
...
tests/migrations/test_autodetector.py
Dosyayı görüntüle @
471fb04a
...
...
@@ -581,7 +581,7 @@ class AutodetectorTests(TestCase):
the FK field before the model to maintain consistency.
"""
before
=
self
.
make_project_state
([
self
.
author_with_publisher
,
self
.
publisher
])
after
=
self
.
make_project_state
([
self
.
author_name
])
# removes both the model and FK
after
=
self
.
make_project_state
([
self
.
author_name
])
# removes both the model and FK
autodetector
=
MigrationAutodetector
(
before
,
after
)
changes
=
autodetector
.
_detect_changes
()
# Right number of migrations?
...
...
@@ -603,7 +603,7 @@ class AutodetectorTests(TestCase):
the field before the model to maintain consistency.
"""
before
=
self
.
make_project_state
([
self
.
book_with_multiple_authors_through_attribution
,
self
.
author_name
,
self
.
attribution
])
after
=
self
.
make_project_state
([
self
.
book_with_no_author
,
self
.
author_name
])
# removes both the through model and ManyToMany
after
=
self
.
make_project_state
([
self
.
book_with_no_author
,
self
.
author_name
])
# removes both the through model and ManyToMany
autodetector
=
MigrationAutodetector
(
before
,
after
)
changes
=
autodetector
.
_detect_changes
()
# Right number of migrations?
...
...
tests/migrations/test_state.py
Dosyayı görüntüle @
471fb04a
...
...
@@ -297,18 +297,21 @@ class StateTests(TestCase):
class
Author
(
models
.
Model
):
name
=
models
.
TextField
()
class
Meta
:
app_label
=
"migrations"
apps
=
new_apps
class
Book
(
models
.
Model
):
author
=
models
.
ForeignKey
(
Author
)
class
Meta
:
app_label
=
"migrations"
apps
=
new_apps
class
Magazine
(
models
.
Model
):
authors
=
models
.
ManyToManyField
(
Author
)
class
Meta
:
app_label
=
"migrations"
apps
=
new_apps
...
...
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