commit 80718040e4370e721b6b3c38654760eab70dac0e
Author: Claude Paroz <claude@2xlibre.net>
Date:   Thu Oct 13 22:16:11 2011 +0200

    Remove duplicate defaults in management commands

diff --git a/django/core/management/commands/createcachetable.py b/django/core/management/commands/createcachetable.py
index 90172b6..a6628a0 100644
--- a/django/core/management/commands/createcachetable.py
+++ b/django/core/management/commands/createcachetable.py
@@ -18,7 +18,7 @@ class Command(LabelCommand):
     requires_model_validation = False
 
     def handle_label(self, tablename, **options):
-        alias = options.get('database', DEFAULT_DB_ALIAS)
+        alias = options.get('database')
         connection = connections[alias]
         fields = (
             # "key" is a reserved word in MySQL, so use "cache_key" instead.
diff --git a/django/core/management/commands/dbshell.py b/django/core/management/commands/dbshell.py
index a6b5427..7465920 100644
--- a/django/core/management/commands/dbshell.py
+++ b/django/core/management/commands/dbshell.py
@@ -16,7 +16,7 @@ class Command(BaseCommand):
     requires_model_validation = False
 
     def handle(self, **options):
-        connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
+        connection = connections[options.get('database')]
         try:
             connection.client.runshell()
         except OSError:
diff --git a/django/core/management/commands/dumpdata.py b/django/core/management/commands/dumpdata.py
index 0426d19..1622929 100644
--- a/django/core/management/commands/dumpdata.py
+++ b/django/core/management/commands/dumpdata.py
@@ -30,13 +30,13 @@ class Command(BaseCommand):
     def handle(self, *app_labels, **options):
         from django.db.models import get_app, get_apps, get_model
 
-        format = options.get('format','json')
-        indent = options.get('indent',None)
-        using = options.get('database', DEFAULT_DB_ALIAS)
-        excludes = options.get('exclude',[])
-        show_traceback = options.get('traceback', False)
-        use_natural_keys = options.get('use_natural_keys', False)
-        use_base_manager = options.get('use_base_manager', False)
+        format = options.get('format')
+        indent = options.get('indent')
+        using = options.get('database')
+        excludes = options.get('exclude')
+        show_traceback = options.get('traceback')
+        use_natural_keys = options.get('use_natural_keys')
+        use_base_manager = options.get('use_base_manager')
 
         excluded_apps = set()
         excluded_models = set()
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 0fe2779..6d0f14e 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -23,9 +23,9 @@ class Command(NoArgsCommand):
            're-executed, and the initial_data fixture will be re-installed.')
 
     def handle_noargs(self, **options):
-        db = options.get('database', DEFAULT_DB_ALIAS)
+        db = options.get('database')
         connection = connections[db]
-        verbosity = int(options.get('verbosity', 1))
+        verbosity = int(options.get('verbosity'))
         interactive = options.get('interactive')
 
         self.style = no_style()
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 90272db..76073c7 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -25,7 +25,7 @@ class Command(NoArgsCommand):
             raise CommandError("Database inspection isn't supported for the currently selected database backend.")
 
     def handle_inspection(self, options):
-        connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
+        connection = connections[options.get('database')]
 
         table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '')
 
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index 7b0e30f..356e2d0 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -34,13 +34,13 @@ class Command(BaseCommand):
     )
 
     def handle(self, *fixture_labels, **options):
-        using = options.get('database', DEFAULT_DB_ALIAS)
+        using = options.get('database')
 
         connection = connections[using]
         self.style = no_style()
 
-        verbosity = int(options.get('verbosity', 1))
-        show_traceback = options.get('traceback', False)
+        verbosity = int(options.get('verbosity'))
+        show_traceback = options.get('traceback')
 
         # commit is a stealth option - it isn't really useful as
         # a command line option, but it can be useful when invoking
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index 2e693e7..a0d2af5 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -140,4 +140,4 @@ class Command(BaseRunserverCommand):
         Serves admin media like old-school (deprecation pending).
         """
         handler = super(Command, self).get_handler(*args, **options)
-        return AdminMediaHandler(handler, options.get('admin_media_path', ''))
+        return AdminMediaHandler(handler, options.get('admin_media_path'))
diff --git a/django/core/management/commands/sql.py b/django/core/management/commands/sql.py
index 582bc8e..59b2e77 100644
--- a/django/core/management/commands/sql.py
+++ b/django/core/management/commands/sql.py
@@ -16,4 +16,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_create(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_create(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlall.py b/django/core/management/commands/sqlall.py
index 8f3a38e..ab702bf 100644
--- a/django/core/management/commands/sqlall.py
+++ b/django/core/management/commands/sqlall.py
@@ -16,4 +16,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_all(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_all(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlclear.py b/django/core/management/commands/sqlclear.py
index c7e3a5e..b8f4913 100644
--- a/django/core/management/commands/sqlclear.py
+++ b/django/core/management/commands/sqlclear.py
@@ -16,4 +16,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_delete(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_delete(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlcustom.py b/django/core/management/commands/sqlcustom.py
index d206b04..6a98456 100644
--- a/django/core/management/commands/sqlcustom.py
+++ b/django/core/management/commands/sqlcustom.py
@@ -16,4 +16,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_custom(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_custom(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py
index 004f0a5..19054fb 100644
--- a/django/core/management/commands/sqlflush.py
+++ b/django/core/management/commands/sqlflush.py
@@ -16,4 +16,4 @@ class Command(NoArgsCommand):
     output_transaction = True
 
     def handle_noargs(self, **options):
-        return u'\n'.join(sql_flush(self.style, connections[options.get('database', DEFAULT_DB_ALIAS)], only_django=True)).encode('utf-8')
+        return u'\n'.join(sql_flush(self.style, connections[options.get('database')], only_django=True)).encode('utf-8')
diff --git a/django/core/management/commands/sqlindexes.py b/django/core/management/commands/sqlindexes.py
index c889f03..bf55b0d 100644
--- a/django/core/management/commands/sqlindexes.py
+++ b/django/core/management/commands/sqlindexes.py
@@ -17,4 +17,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlreset.py b/django/core/management/commands/sqlreset.py
index 13f40de..976b848 100644
--- a/django/core/management/commands/sqlreset.py
+++ b/django/core/management/commands/sqlreset.py
@@ -17,4 +17,4 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        return u'\n'.join(sql_reset(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
+        return u'\n'.join(sql_reset(app, self.style, connections[options.get('database')])).encode('utf-8')
diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py
index aaab38b..6460f00 100644
--- a/django/core/management/commands/sqlsequencereset.py
+++ b/django/core/management/commands/sqlsequencereset.py
@@ -16,5 +16,5 @@ class Command(AppCommand):
     output_transaction = True
 
     def handle_app(self, app, **options):
-        connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
+        connection = connections[options.get('database')]
         return u'\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app, include_auto_created=True))).encode('utf-8')
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
index 4383c34..a9d803a 100644
--- a/django/core/management/commands/syncdb.py
+++ b/django/core/management/commands/syncdb.py
@@ -22,9 +22,9 @@ class Command(NoArgsCommand):
 
     def handle_noargs(self, **options):
 
-        verbosity = int(options.get('verbosity', 1))
+        verbosity = int(options.get('verbosity'))
         interactive = options.get('interactive')
-        show_traceback = options.get('traceback', False)
+        show_traceback = options.get('traceback')
 
         # Stealth option -- 'load_initial_data' is used by the testing setup
         # process to disable initial fixture loading.
@@ -51,7 +51,7 @@ class Command(NoArgsCommand):
                 if not msg.startswith('No module named') or 'management' not in msg:
                     raise
 
-        db = options.get('database', DEFAULT_DB_ALIAS)
+        db = options.get('database')
         connection = connections[db]
         cursor = connection.cursor()
 
diff --git a/django/core/management/commands/test.py b/django/core/management/commands/test.py
index 1b3f2be..2a6dbfc 100644
--- a/django/core/management/commands/test.py
+++ b/django/core/management/commands/test.py
@@ -46,9 +46,7 @@ class Command(BaseCommand):
         from django.test.utils import get_runner
 
         TestRunner = get_runner(settings, options.get('testrunner'))
-        options['verbosity'] = int(options.get('verbosity', 1))
-        options.setdefault('interactive', True)
-        options.setdefault('failfast', False)
+        options['verbosity'] = int(options.get('verbosity'))
 
         test_runner = TestRunner(**options)
         failures = test_runner.run_tests(test_labels)
diff --git a/django/core/management/commands/testserver.py b/django/core/management/commands/testserver.py
index 3f62e57..2e0d8e4 100644
--- a/django/core/management/commands/testserver.py
+++ b/django/core/management/commands/testserver.py
@@ -21,8 +21,8 @@ class Command(BaseCommand):
         from django.core.management import call_command
         from django.db import connection
 
-        verbosity = int(options.get('verbosity', 1))
-        interactive = options.get('interactive', True)
+        verbosity = int(options.get('verbosity'))
+        interactive = options.get('interactive')
         addrport = options.get('addrport')
 
         # Create a test database.
