mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixed #11398 - Added a pre_syncdb signal
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from optparse import make_option
|
||||
import itertools
|
||||
import traceback
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.color import no_style
|
||||
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
|
||||
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal, emit_pre_sync_signal
|
||||
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
|
||||
from django.utils.datastructures import SortedDict
|
||||
from django.utils.importlib import import_module
|
||||
@@ -80,6 +81,9 @@ class Command(NoArgsCommand):
|
||||
for app_name, model_list in all_models
|
||||
)
|
||||
|
||||
create_models = set([x for x in itertools.chain(*manifest.values())])
|
||||
emit_pre_sync_signal(create_models, verbosity, interactive, db)
|
||||
|
||||
# Create the tables for each model
|
||||
if verbosity >= 1:
|
||||
self.stdout.write("Creating tables ...\n")
|
||||
|
||||
Reference in New Issue
Block a user