diff --git a/management/commands/_import_utils.py b/management/commands/_import_utils.py index 3903820..dfd9f4a 100644 --- a/management/commands/_import_utils.py +++ b/management/commands/_import_utils.py @@ -19,7 +19,7 @@ def timed(method): ts = time.time() result = method(*args, **kw) te = time.time() - args[0].print_success(f"{method.__name__} executed ({te-ts:.2f}s)") + args[0].print_success(f"\n {method.__name__} executed ({te-ts:.2f}s)") return result return _timed diff --git a/management/commands/import_activities.py b/management/commands/import_activities.py index 840da02..e4fd7f8 100644 --- a/management/commands/import_activities.py +++ b/management/commands/import_activities.py @@ -58,7 +58,7 @@ class Command(ImportCommand): } # WARNING: Fields lieu, liste, listeimprimee are missing MAP_ACTIVITY[row["id"]] = pk_activity - pk_activity +=1 + pk_activity += 1 bulk_mgr.add(Activity(**obj_dict)) bulk_mgr.done() diff --git a/management/commands/import_nk15.py b/management/commands/import_nk15.py index 629b5f7..b0a8236 100644 --- a/management/commands/import_nk15.py +++ b/management/commands/import_nk15.py @@ -14,5 +14,5 @@ class Command(BaseCommand): 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") + call_command('import_transaction', chunk=10000, buttons=True, map="map.json") # diff --git a/shell/tabularasa b/shell/tabularasa index 6bc837d..0a81c5f 100755 --- a/shell/tabularasa +++ b/shell/tabularasa @@ -1,6 +1,7 @@ #!/usr/bin/sh sudo -u postgres sh -c "dropdb note_db && psql -c 'CREATE DATABASE note_db OWNER note;'"; echo 'reset db'; -source "env/bin/activate" +find apps/ -path "*/migrations/*.py*" -not -name "__init__.py" -delete +./manage.py makemigrations ./manage.py migrate ./manage.py loaddata initial