def get_item_label(self, item):
"""
retrieve item label property
:param item: single item in JSON format
:return: label property
"""
label = EMPTY_RESPONSE
item_type = get_json_property(item, TYPE)
if item_type == 'smartfield':
custom_response_id_to_label_map = self.audit_custom_response_id_to_label_map()
conditional_id = get_json_property(item, 'options', 'condition')
if conditional_id:
label = copy.deepcopy(smartfield_conditional_id_to_statement_map.get(conditional_id)) or EMPTY_RESPONSE
for value in get_json_property(item, 'options', 'values'):
label += '|'
if value in standard_response_id_map.keys():
label += standard_response_id_map[value]
elif value in custom_response_id_to_label_map.keys():
label += custom_response_id_to_label_map[value]
else:
label += str(value)
label += '|'
return label
else:
return get_json_property(item, LABEL)
csvExporter.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录