load date, bio
This commit is contained in:
parent
cb9ffc1a7c
commit
8b531011ce
1 changed files with 4 additions and 2 deletions
|
@ -16,7 +16,7 @@ class Command(BaseCommand):
|
||||||
'query': {
|
'query': {
|
||||||
'conditions': [{'key': 'groups', 'value': options['group'], 'operator': '=='}]
|
'conditions': [{'key': 'groups', 'value': options['group'], 'operator': '=='}]
|
||||||
},
|
},
|
||||||
'keys': ['id', 'title', 'director', 'summary', 'source'],
|
'keys': ['id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location'],
|
||||||
'range': [0, 1000]
|
'range': [0, 1000]
|
||||||
}
|
}
|
||||||
for item in api.find(**query)['data']['items']:
|
for item in api.find(**query)['data']['items']:
|
||||||
|
@ -24,7 +24,9 @@ class Command(BaseCommand):
|
||||||
f, c = models.Film.objects.get_or_create(padma_id=item['id'])
|
f, c = models.Film.objects.get_or_create(padma_id=item['id'])
|
||||||
for key, value in item.items():
|
for key, value in item.items():
|
||||||
if key != 'id':
|
if key != 'id':
|
||||||
f.data[key] = value
|
f.data[{
|
||||||
|
'sourcedescription': 'bio'
|
||||||
|
}.get(key, key)] = value
|
||||||
f.public = True
|
f.public = True
|
||||||
f.slug = item['id']
|
f.slug = item['id']
|
||||||
f.save()
|
f.save()
|
||||||
|
|
Loading…
Reference in a new issue