Ticket #1436: management_error_messages.diff
File management_error_messages.diff, 2.7 KB (added by , 19 years ago) |
---|
-
django/core/management.py
501 501 "Executes the equivalent of 'get_sql_all' in the current database." 502 502 from django.db import connection, transaction 503 503 from cStringIO import StringIO 504 app_name = app.__name__[app.__name__.rindex('.')+1:] 505 app_label = app_name.split('.')[-1] 504 app_name = app.__name__.split('.')[-2] 506 505 507 506 # First, try validating the models. 508 507 s = StringIO() … … 519 518 for sql in sql_list: 520 519 cursor.execute(sql) 521 520 except Exception, e: 522 sys.stderr.write("""Error: % s couldn't be installed. Possible reasons:521 sys.stderr.write("""Error: %(app_name)s couldn't be installed. Possible reasons: 523 522 * The database isn't running or isn't configured correctly. 524 523 * At least one of the database tables already exists. 525 524 * The SQL was invalid. 526 Hint: Look at the output of 'django-admin.py sqlall % s'. That's the SQL this command wasn't able to run.527 The full error: % s\n""" % \528 (app_name, app_label, e))525 Hint: Look at the output of 'django-admin.py sqlall %(app_name)s'. That's the SQL this command wasn't able to run. 526 The full error: %(e)s\n""" % \ 527 locals()) 529 528 transaction.rollback_unless_managed() 530 529 sys.exit(1) 531 530 transaction.commit_unless_managed() … … 536 535 "Executes the equivalent of 'get_sql_reset' in the current database." 537 536 from django.db import connection, transaction 538 537 from cStringIO import StringIO 539 app_name = app.__name__[app.__name__.rindex('.')+1:] 540 app_label = app_name.split('.')[-1] 538 app_name = app.__name__.split('.')[-2] 541 539 542 540 # First, try validating the models. 543 541 s = StringIO() … … 561 559 for sql in sql_list: 562 560 cursor.execute(sql) 563 561 except Exception, e: 564 sys.stderr.write("""Error: % s couldn't be installed. Possible reasons:562 sys.stderr.write("""Error: %(app_name)s couldn't be installed. Possible reasons: 565 563 * The database isn't running or isn't configured correctly. 566 564 * At least one of the database tables already exists. 567 565 * The SQL was invalid. 568 Hint: Look at the output of 'django-admin.py sqlreset % s'. That's the SQL this command wasn't able to run.569 The full error: % s\n""" % \570 (app_name, app_label, e))566 Hint: Look at the output of 'django-admin.py sqlreset %(app_name)s'. That's the SQL this command wasn't able to run. 567 The full error: %(e)s\n""" % \ 568 locals()) 571 569 transaction.rollback_unless_managed() 572 570 sys.exit(1) 573 571 transaction.commit_unless_managed()