diff options
| author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
| commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
| tree | f0506b668a013d0063e5fba3dbf4863b466713ba /django/core/management/commands/sqlsequencereset.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'django/core/management/commands/sqlsequencereset.py')
| -rw-r--r-- | django/core/management/commands/sqlsequencereset.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py index 1d74ed9f55..454a2ab10c 100644 --- a/django/core/management/commands/sqlsequencereset.py +++ b/django/core/management/commands/sqlsequencereset.py @@ -3,23 +3,26 @@ from django.db import DEFAULT_DB_ALIAS, connections class Command(AppCommand): - help = 'Prints the SQL statements for resetting sequences for the given app name(s).' + help = ( + "Prints the SQL statements for resetting sequences for the given app name(s)." + ) output_transaction = True def add_arguments(self, parser): super().add_arguments(parser) parser.add_argument( - '--database', default=DEFAULT_DB_ALIAS, + "--database", + default=DEFAULT_DB_ALIAS, help='Nominates a database to print the SQL for. Defaults to the "default" database.', ) def handle_app_config(self, app_config, **options): if app_config.models_module is None: return - connection = connections[options['database']] + connection = connections[options["database"]] models = app_config.get_models(include_auto_created=True) statements = connection.ops.sequence_reset_sql(self.style, models) - if not statements and options['verbosity'] >= 1: - self.stderr.write('No sequences found.') - return '\n'.join(statements) + if not statements and options["verbosity"] >= 1: + self.stderr.write("No sequences found.") + return "\n".join(statements) |
