prepare for bio translations
This commit is contained in:
parent
85b4a0b7d6
commit
2abeacccb6
3 changed files with 23 additions and 3 deletions
|
|
@ -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']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue