2020-02-24 13:19:40 +00:00
|
|
|
#!/usr/env/bin python3
|
2020-05-24 23:18:24 +00:00
|
|
|
import subprocess
|
2020-05-02 14:08:40 +00:00
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from django.core.management import call_command
|
2020-04-27 00:08:01 +00:00
|
|
|
|
2020-02-24 13:19:40 +00:00
|
|
|
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.
|
|
|
|
"""
|
2020-04-26 23:19:56 +00:00
|
|
|
|
2020-02-24 13:19:40 +00:00
|
|
|
def handle(self, *args, **kwargs):
|
2020-05-24 23:18:24 +00:00
|
|
|
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', buttons=True, map="map.json")
|
|
|
|
#
|