1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Improved error handling for management.py commands, especially for no argument or non-applabel argument commands.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5903 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2007-08-16 14:34:01 +00:00
parent c568792e81
commit 83f5f700b0
13 changed files with 116 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
from django.core.management.base import BaseCommand
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
try:
@@ -6,15 +6,15 @@ try:
except NameError:
from sets import Set as set # Python 2.3 fallback
class Command(BaseCommand):
class Command(NoArgsCommand):
help = "Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
args = '[--verbosity] [--noinput]'
def handle(self, **options):
def handle_noargs(self, **options):
from django.db import backend, connection, transaction, models
from django.conf import settings
from django.core.management.sql import table_list, installed_models, sql_model_create, sql_for_pending_references, many_to_many_sql_for_model, custom_sql_for_model, sql_indexes_for_model, emit_post_sync_signal
verbosity = int(options.get('verbosity', 1))
interactive = options.get('interactive')