summaryrefslogtreecommitdiff
path: root/ishtar_common/management/commands/update_specific_importers.py
blob: 46669a2366ba4ac368c2e0996061a4fdfa69b4f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()