From 5fa63f2abec036eea76cde735bb187bbeef77c20 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 18 May 2020 19:38:25 +0200 Subject: [PATCH] make chunk an herited argument --- management/commands/_import_utils.py | 1 + management/commands/import_account.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/management/commands/_import_utils.py b/management/commands/_import_utils.py index 80c7b59..d9243a3 100644 --- a/management/commands/_import_utils.py +++ b/management/commands/_import_utils.py @@ -33,6 +33,7 @@ class ImportCommand(BaseCommand): parser.add_argument('--nk15user', action='store', default='nk15_user', help='NK15 database owner') parser.add_argument('-s', '--save', action='store', help="save mapping of idbde") parser.add_argument('-m', '--map', action='store', help="import mapping of idbde") + parser.add_argument('-c', '--chunk', type=int, default=100, help="chunk size for bulk_create") return parser diff --git a/management/commands/import_account.py b/management/commands/import_account.py index b173265..3f7a789 100644 --- a/management/commands/import_account.py +++ b/management/commands/import_account.py @@ -38,9 +38,8 @@ class Command(ImportCommand): """ def add_arguments(self, parser): - parser.add_argument('-a', '--alias', action='store', help="import alias") - parser.add_argument('-c', '--chunk', type=int, default=100, help="chunk size for bulk_create") - + parser.add_argument('-a', '--alias', action='store_true', help="import alias") + @transaction.atomic def import_account(self, cur, chunk_size): """