Changeset 3892
- Timestamp:
- 10/03/06 08:23:49 (2 years ago)
- Files:
-
- django/trunk/django/core/management.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management.py
r3890 r3892 398 398 399 399 def get_sql_indexes(app): 400 "Returns a list of the CREATE INDEX SQL statements for the given app."400 "Returns a list of the CREATE INDEX SQL statements for all models in the given app." 401 401 from django.db import models 402 402 output = [] … … 408 408 409 409 def _get_sql_index(model): 410 "Returns the CREATE INDEX SQL statements for a s pecificmodel"410 "Returns the CREATE INDEX SQL statements for a single model" 411 411 from django.db import backend 412 412 output = [] … … 464 464 465 465 for app in models.get_apps(): 466 app_name = app.__name__.split('.')[-2] 466 467 model_list = models.get_models(app) 467 468 for model in model_list: 468 469 # Create the model's database table, if it doesn't already exist. 469 470 if verbosity >= 2: 470 print "Processing model %s" % model._meta471 print "Processing %s.%s model" % (app_name, model._meta.object_name) 471 472 if model._meta.db_table in table_list: 472 473 continue … … 488 489 if sql: 489 490 if verbosity >= 2: 490 print "Creating many-to-many tables for %s model" % model.__name__491 print "Creating many-to-many tables for %s.%s model" % (app_name, model._meta.object_name) 491 492 for statement in sql: 492 493 cursor.execute(statement) … … 497 498 # to do at this point. 498 499 for app in models.get_apps(): 500 app_name = app.__name__.split('.')[-2] 499 501 if verbosity >= 2: 500 print " Sending post-syncdb signal for application", app.__name__.split('.')[-2]502 print "Running post-sync handlers for application", app_name 501 503 dispatcher.send(signal=signals.post_syncdb, sender=app, 502 504 app=app, created_models=created_models, … … 510 512 if initial_sql: 511 513 if verbosity >= 1: 512 print "Installing initial data for %s model" % model._meta.object_name514 print "Installing initial data for %s.%s model" % model._meta.object_name 513 515 try: 514 516 for sql in initial_sql: 515 517 cursor.execute(sql) 516 518 except Exception, e: 517 sys.stderr.write("Failed to install initial SQL data for %s model: %s" % \518 ( model._meta.object_name, e))519 sys.stderr.write("Failed to install initial SQL data for %s.%s model: %s" % \ 520 (app_name, model._meta.object_name, e)) 519 521 transaction.rollback_unless_managed() 520 522 else: 521 523 transaction.commit_unless_managed() 522 524 523 525 syncdb.args = '' 524 526
