dual title, director

This commit is contained in:
j 2021-10-11 19:03:23 +01:00
commit 85b4a0b7d6
4 changed files with 40 additions and 8 deletions

View file

@ -18,7 +18,7 @@ class Command(BaseCommand):
},
'keys': [
'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location',
'duration'
'duration', 'featuring', 'cinematographer'
],
'range': [0, 1000]
}
@ -26,7 +26,9 @@ class Command(BaseCommand):
print(item)
f, c = models.Film.objects.get_or_create(padma_id=item['id'])
for key, value in item.items():
if key != 'id':
if key == 'title':
f.data['title'], f.data['title_zh'] = value.split(' / ', 1)
elif key != 'id':
f.data[{
'sourcedescription': 'bio'
}.get(key, key)] = value