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
66a99fa2
Kaydet (Commit)
66a99fa2
authored
Haz 17, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #2824 from valberg/22577
Fixed #22577: Python 3 broke on non-module migrations directory
üst
95cc0e15
3a6cb9f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
writer.py
django/db/migrations/writer.py
+6
-0
.keep
...s/migrations_test_apps/without_init_file/migrations/.keep
+0
-0
test_writer.py
tests/migrations/test_writer.py
+1
-0
No files found.
django/db/migrations/writer.py
Dosyayı görüntüle @
66a99fa2
...
@@ -158,6 +158,12 @@ class MigrationWriter(object):
...
@@ -158,6 +158,12 @@ class MigrationWriter(object):
# See if we can import the migrations module directly
# See if we can import the migrations module directly
try
:
try
:
migrations_module
=
import_module
(
migrations_package_name
)
migrations_module
=
import_module
(
migrations_package_name
)
# Python 3 fails when the migrations directory does not have a
# __init__.py file
if
not
hasattr
(
migrations_module
,
'__file__'
):
raise
ImportError
basedir
=
os
.
path
.
dirname
(
migrations_module
.
__file__
)
basedir
=
os
.
path
.
dirname
(
migrations_module
.
__file__
)
except
ImportError
:
except
ImportError
:
app_config
=
apps
.
get_app_config
(
self
.
migration
.
app_label
)
app_config
=
apps
.
get_app_config
(
self
.
migration
.
app_label
)
...
...
tests/migrations/migrations_test_apps/without_init_file/migrations/.keep
0 → 100644
Dosyayı görüntüle @
66a99fa2
tests/migrations/test_writer.py
Dosyayı görüntüle @
66a99fa2
...
@@ -215,6 +215,7 @@ class WriterTests(TestCase):
...
@@ -215,6 +215,7 @@ class WriterTests(TestCase):
test_apps
=
[
test_apps
=
[
'migrations.migrations_test_apps.normal'
,
'migrations.migrations_test_apps.normal'
,
'migrations.migrations_test_apps.with_package_model'
,
'migrations.migrations_test_apps.with_package_model'
,
'migrations.migrations_test_apps.without_init_file'
,
]
]
base_dir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
base_dir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
...
...
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