nk20-scripts/management/commands/import_nk15.py

19 lines
661 B
Python

#!/usr/env/bin python3
import subprocess
from django.core.management.base import BaseCommand
from django.core.management import call_command
class Command(BaseCommand):
"""
Command for importing the database of NK15.
Need to be run by a user with a registered role in postgres for the database nk15.
"""
def handle(self, *args, **kwargs):
subprocess.call("./apps/scripts/shell/tabularasa")
call_command('import_account', alias=True, chunk=1000, save = "map.json")
call_command('import_activities', chunk=100, map="map.json")
call_command('import_transaction', chunk=10000, buttons=True, map="map.json")
#