import handling
This commit is contained in:
parent
af8f7433c3
commit
b571bb2271
1 changed files with 3 additions and 0 deletions
3
utils.py
3
utils.py
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue