summaryrefslogtreecommitdiff
path: root/ishtar_common/management
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-10-19 18:03:52 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-10-19 18:03:52 +0200
commit87afa869477c69bbb3c36083fea076e47d565d4c (patch)
tree3ca1c92883f0c8962fb439c46f44fcf0a677d741 /ishtar_common/management
parentab3d757dc4bf17c127644fad185979a630ad6240 (diff)
downloadIshtar-87afa869477c69bbb3c36083fea076e47d565d4c.tar.bz2
Ishtar-87afa869477c69bbb3c36083fea076e47d565d4c.zip
Imports: create fake importer on database for specific importers
Diffstat (limited to 'ishtar_common/management')
-rw-r--r--ishtar_common/management/commands/update_specific_importers.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ishtar_common/management/commands/update_specific_importers.py b/ishtar_common/management/commands/update_specific_importers.py
new file mode 100644
index 000000000..46669a236
--- /dev/null
+++ b/ishtar_common/management/commands/update_specific_importers.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from django.core.management.base import BaseCommand
+from django.conf import settings
+
+IMPORTERS = []
+
+
+if 'archaeological_files' in settings.INSTALLED_APPS:
+ from archaeological_files.data_importer import FileImporterSraPdL
+ IMPORTERS.append(FileImporterSraPdL)
+
+
+class Command(BaseCommand):
+ help = "Update each specific importer"
+
+ def handle(self, *args, **options):
+ for importer in IMPORTERS:
+ response = importer()._create_models()
+ if response:
+ self.stdout.write("%s configured\n" % importer.__name__)
+ self.stdout.flush()