fix data
This commit is contained in:
parent
9bdecf715e
commit
3ce08c76d6
1 changed files with 7 additions and 0 deletions
7
fixdata.py
Normal file
7
fixdata.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from item.models import Item
|
||||
|
||||
def fix_topic(old, new):
|
||||
for i in Item.objects.all():
|
||||
if old in i.data.get('topics', []):
|
||||
i.data['topics'] = [new if t == old else t for t in i.data['topics']]
|
||||
i.save()
|
Loading…
Reference in a new issue