import handling

This commit is contained in:
j 2023-10-28 11:24:43 +02:00
parent af8f7433c3
commit b571bb2271

View file

@ -4,6 +4,7 @@ def upgrade_originals():
import item.models import item.models
import itemlist.models import itemlist.models
nt = itemlist.models.List.objects.get(name='No Type') 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): for i in nt.get_items(nt.user):
orig = item.models.Item.objects.get(data__title=i.get('title'), data__type=["Original"]) orig = item.models.Item.objects.get(data__title=i.get('title'), data__type=["Original"])
print(i, orig) print(i, orig)
@ -14,9 +15,11 @@ def upgrade_originals():
orig.make_poster() orig.make_poster()
i.data['type'] = ['Empty'] i.data['type'] = ['Empty']
i.save() i.save()
no.items.add(orig)
def remove_deselected_files(): def remove_deselected_files():
import itemlist.models
il = itemlist.models.List.objects.get(name='New Originals') il = itemlist.models.List.objects.get(name='New Originals')
for i in il.items.all(): for i in il.items.all():
changed = False changed = False