diff --git a/apis_instance_nsvis/management/commands/importannotations.py b/apis_instance_nsvis/management/commands/importannotations.py index 173981a..b77dc3a 100644 --- a/apis_instance_nsvis/management/commands/importannotations.py +++ b/apis_instance_nsvis/management/commands/importannotations.py @@ -10,6 +10,14 @@ labelstudio_token = os.getenv("LABELSTUDIO_TOKEN", None) +def override(project, attribute): + match project: + case 69: + if attribute == "issue": + return "Wiener Illustrierte vom 23.11.1944" + return None + + class Command(BaseCommand): help = "Import data from LabelStudio Export" @@ -42,7 +50,7 @@ def handle(self, *args, **options): ann_ids.append(annotation.id) annotation.data = annotations[ann] annotation.image = task["data"]["image"] - annotation.issue = task["data"]["issue"] + annotation.issue = override(project, "issue") or task["data"]["issue"] annotation.save() Annotation.objects.exclude(id__in=ann_ids).delete() for ann in Annotation.objects.all():