diff options
| author | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
|---|---|---|
| committer | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
| commit | dd49269c7db008b2567f50cb03c4d3d9b321daa1 (patch) | |
| tree | 326dd25bb045ac016cda7966b43cbdfe1f67d699 /django/core/management/commands/syncdb.py | |
| parent | c9b188c4ec939abbe48dae5a371276742e64b6b8 (diff) | |
[soc2010/app-loading] merged trunkarchive/soc2010/app-loading
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management/commands/syncdb.py')
| -rw-r--r-- | django/core/management/commands/syncdb.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py index 6f1a198653..835e06f24a 100644 --- a/django/core/management/commands/syncdb.py +++ b/django/core/management/commands/syncdb.py @@ -77,10 +77,12 @@ class Command(NoArgsCommand): ) # Create the tables for each model + if verbosity >= 1: + print "Creating tables ..." for app_name, model_list in manifest.items(): for model in model_list: # Create the model's database table, if it doesn't already exist. - if verbosity >= 2: + if verbosity >= 3: print "Processing %s.%s model" % (app_name, model._meta.object_name) sql, references = connection.creation.sql_create_model(model, self.style, seen_models) seen_models.add(model) @@ -108,12 +110,14 @@ class Command(NoArgsCommand): # Install custom SQL for the app (but only if this # is a model we've just created) + if verbosity >= 1: + print "Installing custom SQL ..." for app_name, model_list in manifest.items(): for model in model_list: if model in created_models: custom_sql = custom_sql_for_model(model, self.style, connection) if custom_sql: - if verbosity >= 1: + if verbosity >= 2: print "Installing custom SQL for %s.%s model" % (app_name, model._meta.object_name) try: for sql in custom_sql: @@ -128,16 +132,18 @@ class Command(NoArgsCommand): else: transaction.commit_unless_managed(using=db) else: - if verbosity >= 2: + if verbosity >= 3: print "No custom SQL for %s.%s model" % (app_name, model._meta.object_name) + if verbosity >= 1: + print "Installing indexes ..." # Install SQL indicies for all newly created models for app_name, model_list in manifest.items(): for model in model_list: if model in created_models: index_sql = connection.creation.sql_indexes_for_model(model, self.style) if index_sql: - if verbosity >= 1: + if verbosity >= 2: print "Installing index for %s.%s model" % (app_name, model._meta.object_name) try: for sql in index_sql: |
