From b571bb22711e0b7bdc69484b8c4921d192e5d323 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 28 Oct 2023 11:24:43 +0200 Subject: [PATCH] import handling --- utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils.py b/utils.py index 04c7a49..b6efc6d 100644 --- a/utils.py +++ b/utils.py @@ -4,6 +4,7 @@ def upgrade_originals(): import item.models import itemlist.models nt = itemlist.models.List.objects.get(name='No Type') + no = itemlist.models.List.objects.get(name='New Originals') for i in nt.get_items(nt.user): orig = item.models.Item.objects.get(data__title=i.get('title'), data__type=["Original"]) print(i, orig) @@ -14,9 +15,11 @@ def upgrade_originals(): orig.make_poster() i.data['type'] = ['Empty'] i.save() + no.items.add(orig) def remove_deselected_files(): + import itemlist.models il = itemlist.models.List.objects.get(name='New Originals') for i in il.items.all(): changed = False