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
23c61219
Kaydet (Commit)
23c61219
authored
Şub 28, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified emit_post_migrate from flush command
Follow-up of
f4f24d30
.
üst
90ab6ee6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
flush.py
django/core/management/commands/flush.py
+4
-11
testcases.py
django/test/testcases.py
+2
-2
No files found.
django/core/management/commands/flush.py
Dosyayı görüntüle @
23c61219
...
...
@@ -7,7 +7,7 @@ from django.apps import apps
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management.color
import
no_style
from
django.core.management.sql
import
emit_post_migrate_signal
,
sql_flush
from
django.db
import
DEFAULT_DB_ALIAS
,
connections
,
router
,
transaction
from
django.db
import
DEFAULT_DB_ALIAS
,
connections
,
transaction
from
django.utils
import
six
from
django.utils.six.moves
import
input
...
...
@@ -76,15 +76,8 @@ Are you sure you want to do this?
six
.
reraise
(
CommandError
,
CommandError
(
new_msg
),
sys
.
exc_info
()[
2
])
if
not
inhibit_post_migrate
:
self
.
emit_post_migrate
(
verbosity
,
interactive
,
database
)
# Emit the post migrate signal. This allows individual applications to
# respond as if the database had been migrated from scratch.
emit_post_migrate_signal
(
verbosity
,
interactive
,
database
)
else
:
self
.
stdout
.
write
(
"Flush cancelled.
\n
"
)
@staticmethod
def
emit_post_migrate
(
verbosity
,
interactive
,
database
):
# Emit the post migrate signal. This allows individual applications to
# respond as if the database had been migrated from scratch.
all_models
=
[]
for
app_config
in
apps
.
get_app_configs
():
all_models
.
extend
(
router
.
get_migratable_models
(
app_config
,
database
,
include_auto_created
=
True
))
emit_post_migrate_signal
(
verbosity
,
interactive
,
database
)
django/test/testcases.py
Dosyayı görüntüle @
23c61219
...
...
@@ -23,7 +23,7 @@ from django.core.exceptions import ImproperlyConfigured, ValidationError
from
django.core.handlers.wsgi
import
WSGIHandler
,
get_path_info
from
django.core.management
import
call_command
from
django.core.management.color
import
no_style
from
django.core.management.
commands
import
flush
from
django.core.management.
sql
import
emit_post_migrate_signal
from
django.core.servers.basehttp
import
WSGIRequestHandler
,
WSGIServer
from
django.core.urlresolvers
import
clear_url_caches
,
set_urlconf
from
django.db
import
DEFAULT_DB_ALIAS
,
connection
,
connections
,
transaction
...
...
@@ -777,7 +777,7 @@ class TransactionTestCase(SimpleTestCase):
value
=
self
.
available_apps
,
enter
=
True
)
for
db_name
in
self
.
_databases_names
(
include_mirrors
=
False
):
flush
.
Command
.
emit_post_migrate
(
verbosity
=
0
,
interactive
=
False
,
database
=
db_name
)
emit_post_migrate_signal
(
verbosity
=
0
,
interactive
=
False
,
db
=
db_name
)
try
:
self
.
_fixture_setup
()
except
Exception
:
...
...
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