prepare for bio translations

This commit is contained in:
j 2021-10-11 19:20:13 +01:00
commit 2abeacccb6
3 changed files with 23 additions and 3 deletions

View file

@ -28,9 +28,13 @@ class Command(BaseCommand):
for key, value in item.items():
if key == 'title':
f.data['title'], f.data['title_zh'] = value.split(' / ', 1)
elif key == 'sourcedescription':
if '<br><br>' in value:
f.data['bio'], f.data['bio_zh'] = value.split('<br><br>', 1)
else:
f.data['bio'] = f.data['bio_zh'] = value
elif key != 'id':
f.data[{
'sourcedescription': 'bio'
}.get(key, key)] = value
f.public = True
f.slug = item['id']