diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-10-22 13:59:09 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-10-22 13:59:09 +0200 |
commit | 03b0dbd17b7c0e09db960048d89e59092d119753 (patch) | |
tree | bfebf3cefb7a8a2e606462a87337146d4d764a58 /ishtar_common/management | |
parent | 398a928d10f93bcf92be97e7ecca3638e5a27362 (diff) | |
download | Ishtar-03b0dbd17b7c0e09db960048d89e59092d119753.tar.bz2 Ishtar-03b0dbd17b7c0e09db960048d89e59092d119753.zip |
Importers: allow the deletion of specific importers on generation
Diffstat (limited to 'ishtar_common/management')
-rw-r--r-- | ishtar_common/management/commands/update_specific_importers.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ishtar_common/management/commands/update_specific_importers.py b/ishtar_common/management/commands/update_specific_importers.py index 46669a236..c5445eb0b 100644 --- a/ishtar_common/management/commands/update_specific_importers.py +++ b/ishtar_common/management/commands/update_specific_importers.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from optparse import make_option + from django.core.management.base import BaseCommand from django.conf import settings @@ -14,10 +16,19 @@ if 'archaeological_files' in settings.INSTALLED_APPS: class Command(BaseCommand): help = "Update each specific importer" + option_list = list(BaseCommand.option_list) + [ + make_option( + '--force', + action='store_true', + dest='force', + default=False, + help='Force the deletion of existing importers. ' + 'ATTENTION: all associated imports and all associated items ' + 'will be deleted.')] def handle(self, *args, **options): for importer in IMPORTERS: - response = importer()._create_models() + response = importer()._create_models(force=options['force']) if response: self.stdout.write("%s configured\n" % importer.__name__) self.stdout.flush() |