diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-02 16:14:45 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-02 16:41:08 +0100 |
commit | 0dc167611a2f9fecc58b9709487362ceb3eb9752 (patch) | |
tree | 734d1eddcc720b9663852845862095979bc415a9 /ishtar_common/management/commands/update_external_ids.py | |
parent | f4d375c0e76b9d01bf5ac8311c220d5d80a55b41 (diff) | |
download | Ishtar-0dc167611a2f9fecc58b9709487362ceb3eb9752.tar.bz2 Ishtar-0dc167611a2f9fecc58b9709487362ceb3eb9752.zip |
Maintenance scripts: delete deprecated and migrate to ishtar_maintenance
Diffstat (limited to 'ishtar_common/management/commands/update_external_ids.py')
-rw-r--r-- | ishtar_common/management/commands/update_external_ids.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/ishtar_common/management/commands/update_external_ids.py b/ishtar_common/management/commands/update_external_ids.py deleted file mode 100644 index f69a865d7..000000000 --- a/ishtar_common/management/commands/update_external_ids.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import sys - -from django.core.management.base import BaseCommand - -from archaeological_operations.models import Parcel -from archaeological_context_records.models import ContextRecord -from archaeological_finds.models import BaseFind, Find - - -class Command(BaseCommand): - help = "./manage.py ishtar_execute_admin_tasks\n\n"\ - "Launch pending administration tasks." - - def handle(self, *args, **options): - for model in [Parcel, ContextRecord, BaseFind, Find]: - updated = 0 - print("* {}".format(model)) - total = model.objects.count() - for idx, item in enumerate(model.objects.all()): - sys.stdout.write("\r{}/{} ".format(idx, total)) - sys.stdout.flush() - updated += 1 if item.update_external_id(save=True) else 0 - print("\rupdated: {} ".format(updated)) |