Handle RangeNameLanguage for import of Range
This commit is contained in:
parent
322ad9ad8f
commit
0c80526c84
1 changed files with 5 additions and 0 deletions
|
@ -392,6 +392,11 @@ def handle_object_dict(object_dict, model_name):
|
|||
# Reinstate range_name key
|
||||
object_dict['range_name'] = object_dict['range_name_id']
|
||||
object_dict.pop('range_name_id')
|
||||
if 'range_name_language' in object_dict:
|
||||
print('Getting range_name_language of %s' % object_dict['range_name_language'])
|
||||
if object_dict['range_name_language'] == '':
|
||||
object_dict['range_name_language'] = 0
|
||||
object_dict['range_name_language'] = Language.objects.get(id=int(object_dict['range_name_language']))
|
||||
if model_name == 'Keyword':
|
||||
object_dict['keyword'] = object_dict['keyword_id']
|
||||
object_dict.pop('keyword_id')
|
||||
|
|
Loading…
Reference in a new issue