-
diff --git a/django/core/management/commands/createcachetable.py b/django/core/management/commands/createcachetable.py
index 90172b6..a6628a0 100644
a
|
b
|
class Command(LabelCommand):
|
18 | 18 | requires_model_validation = False |
19 | 19 | |
20 | 20 | def handle_label(self, tablename, **options): |
21 | | alias = options.get('database', DEFAULT_DB_ALIAS) |
| 21 | alias = options.get('database') |
22 | 22 | connection = connections[alias] |
23 | 23 | fields = ( |
24 | 24 | # "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
|
b
|
class Command(BaseCommand):
|
16 | 16 | requires_model_validation = False |
17 | 17 | |
18 | 18 | def handle(self, **options): |
19 | | connection = connections[options.get('database', DEFAULT_DB_ALIAS)] |
| 19 | connection = connections[options.get('database')] |
20 | 20 | try: |
21 | 21 | connection.client.runshell() |
22 | 22 | except OSError: |
-
diff --git a/django/core/management/commands/dumpdata.py b/django/core/management/commands/dumpdata.py
index 706bf60..162135a 100644
a
|
b
|
class Command(BaseCommand):
|
30 | 30 | def handle(self, *app_labels, **options): |
31 | 31 | from django.db.models import get_app, get_apps, get_models, get_model |
32 | 32 | |
33 | | format = options.get('format','json') |
34 | | indent = options.get('indent',None) |
35 | | using = options.get('database', DEFAULT_DB_ALIAS) |
| 33 | format = options.get('format') |
| 34 | indent = options.get('indent') |
| 35 | using = options.get('database') |
36 | 36 | connection = connections[using] |
37 | | excludes = options.get('exclude',[]) |
38 | | show_traceback = options.get('traceback', False) |
39 | | use_natural_keys = options.get('use_natural_keys', False) |
40 | | use_base_manager = options.get('use_base_manager', False) |
| 37 | excludes = options.get('exclude') |
| 38 | show_traceback = options.get('traceback') |
| 39 | use_natural_keys = options.get('use_natural_keys') |
| 40 | use_base_manager = options.get('use_base_manager') |
41 | 41 | |
42 | 42 | excluded_apps = set() |
43 | 43 | excluded_models = set() |
-
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index bcadb96..4eb329a 100644
a
|
b
|
class Command(NoArgsCommand):
|
20 | 20 | help = "Executes ``sqlflush`` on the current database." |
21 | 21 | |
22 | 22 | def handle_noargs(self, **options): |
23 | | db = options.get('database', DEFAULT_DB_ALIAS) |
| 23 | db = options.get('database') |
24 | 24 | connection = connections[db] |
25 | | verbosity = int(options.get('verbosity', 1)) |
| 25 | verbosity = int(options.get('verbosity')) |
26 | 26 | interactive = options.get('interactive') |
27 | 27 | |
28 | 28 | self.style = no_style() |
-
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index e45f22c..27c4f0f 100644
a
|
b
|
class Command(NoArgsCommand):
|
25 | 25 | raise CommandError("Database inspection isn't supported for the currently selected database backend.") |
26 | 26 | |
27 | 27 | def handle_inspection(self, options): |
28 | | connection = connections[options.get('database', DEFAULT_DB_ALIAS)] |
| 28 | connection = connections[options.get('database')] |
29 | 29 | |
30 | 30 | table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '') |
31 | 31 | |
-
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index 34f3543..2ca8db2 100644
a
|
b
|
class Command(BaseCommand):
|
29 | 29 | ) |
30 | 30 | |
31 | 31 | def handle(self, *fixture_labels, **options): |
32 | | using = options.get('database', DEFAULT_DB_ALIAS) |
| 32 | using = options.get('database') |
33 | 33 | |
34 | 34 | connection = connections[using] |
35 | 35 | self.style = no_style() |
36 | 36 | |
37 | | verbosity = int(options.get('verbosity', 1)) |
38 | | show_traceback = options.get('traceback', False) |
| 37 | verbosity = int(options.get('verbosity')) |
| 38 | show_traceback = options.get('traceback') |
39 | 39 | |
40 | 40 | # commit is a stealth option - it isn't really useful as |
41 | 41 | # 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 b63b57a..7324ff3 100644
a
|
b
|
class Command(BaseRunserverCommand):
|
128 | 128 | Serves admin media like old-school (deprecation pending). |
129 | 129 | """ |
130 | 130 | handler = super(Command, self).get_handler(*args, **options) |
131 | | return AdminMediaHandler(handler, options.get('admin_media_path', '')) |
| 131 | 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
|
b
|
class Command(AppCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_app(self, app, **options): |
19 | | return u'\n'.join(sql_create(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 19 | 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
|
b
|
class Command(AppCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_app(self, app, **options): |
19 | | return u'\n'.join(sql_all(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 19 | 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
|
b
|
class Command(AppCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_app(self, app, **options): |
19 | | return u'\n'.join(sql_delete(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 19 | 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
|
b
|
class Command(AppCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_app(self, app, **options): |
19 | | return u'\n'.join(sql_custom(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 19 | 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
|
b
|
class Command(NoArgsCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_noargs(self, **options): |
19 | | return u'\n'.join(sql_flush(self.style, connections[options.get('database', DEFAULT_DB_ALIAS)], only_django=True)).encode('utf-8') |
| 19 | 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
|
b
|
class Command(AppCommand):
|
17 | 17 | output_transaction = True |
18 | 18 | |
19 | 19 | def handle_app(self, app, **options): |
20 | | return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 20 | 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
|
b
|
class Command(AppCommand):
|
17 | 17 | output_transaction = True |
18 | 18 | |
19 | 19 | def handle_app(self, app, **options): |
20 | | return u'\n'.join(sql_reset(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8') |
| 20 | 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
|
b
|
class Command(AppCommand):
|
16 | 16 | output_transaction = True |
17 | 17 | |
18 | 18 | def handle_app(self, app, **options): |
19 | | connection = connections[options.get('database', DEFAULT_DB_ALIAS)] |
| 19 | connection = connections[options.get('database')] |
20 | 20 | 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 3c11a26..5602246 100644
a
|
b
|
class Command(NoArgsCommand):
|
22 | 22 | |
23 | 23 | def handle_noargs(self, **options): |
24 | 24 | |
25 | | verbosity = int(options.get('verbosity', 1)) |
| 25 | verbosity = int(options.get('verbosity')) |
26 | 26 | interactive = options.get('interactive') |
27 | | show_traceback = options.get('traceback', False) |
| 27 | show_traceback = options.get('traceback') |
28 | 28 | |
29 | 29 | self.style = no_style() |
30 | 30 | |
… |
… |
class Command(NoArgsCommand):
|
47 | 47 | if not msg.startswith('No module named') or 'management' not in msg: |
48 | 48 | raise |
49 | 49 | |
50 | | db = options.get('database', DEFAULT_DB_ALIAS) |
| 50 | db = options.get('database') |
51 | 51 | connection = connections[db] |
52 | 52 | cursor = connection.cursor() |
53 | 53 | |
-
diff --git a/django/core/management/commands/test.py b/django/core/management/commands/test.py
index 1431f00..c4924ba 100644
a
|
b
|
class Command(BaseCommand):
|
18 | 18 | from django.conf import settings |
19 | 19 | from django.test.utils import get_runner |
20 | 20 | |
21 | | verbosity = int(options.get('verbosity', 1)) |
22 | | interactive = options.get('interactive', True) |
23 | | failfast = options.get('failfast', False) |
| 21 | verbosity = int(options.get('verbosity')) |
| 22 | interactive = options.get('interactive') |
| 23 | failfast = options.get('failfast') |
24 | 24 | TestRunner = get_runner(settings) |
25 | 25 | |
26 | 26 | if hasattr(TestRunner, 'func_name'): |
-
diff --git a/django/core/management/commands/testserver.py b/django/core/management/commands/testserver.py
index 3f62e57..2e0d8e4 100644
a
|
b
|
class Command(BaseCommand):
|
21 | 21 | from django.core.management import call_command |
22 | 22 | from django.db import connection |
23 | 23 | |
24 | | verbosity = int(options.get('verbosity', 1)) |
25 | | interactive = options.get('interactive', True) |
| 24 | verbosity = int(options.get('verbosity')) |
| 25 | interactive = options.get('interactive') |
26 | 26 | addrport = options.get('addrport') |
27 | 27 | |
28 | 28 | # Create a test database. |