1
0
mirror of https://gitlab.crans.org/bde/nk20-scripts synced 2025-06-30 02:01:07 +02:00

Fix activities import

This commit is contained in:
Yohann D'ANELLO
2020-07-22 01:28:28 +02:00
parent ee54fca89e
commit 4839b2deb8
5 changed files with 62 additions and 20 deletions

View File

@ -4,7 +4,9 @@ import subprocess
from django.core.management.base import BaseCommand
from django.core.management import call_command
class Command(BaseCommand):
from ._import_utils import ImportCommand
class Command(ImportCommand):
"""
Command for importing the database of NK15.
Need to be run by a user with a registered role in postgres for the database nk15.
@ -12,7 +14,20 @@ class Command(BaseCommand):
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")
kwargs["alias"] = True
kwargs["chunk"] = 1000
kwargs["save"] = "map.json"
call_command('import_account', **kwargs)
del kwargs["alias"]
del kwargs["save"]
kwargs["chunk"] = 100
kwargs["map"] = "map.json"
call_command('import_activities', **kwargs)
kwargs["chunk"] = 10000
kwargs["map"] = "map.json"
kwargs["buttons"] = True
call_command('import_transaction', **kwargs)
#