Commit ee7eafb4 authored by Yusei Tahara's avatar Yusei Tahara

Fix getSortedCategoryList. Category may be a predicate located in non base category document.

parent 688cf160
...@@ -540,17 +540,16 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list): ...@@ -540,17 +540,16 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
return range_list return range_list
def getSortedCategoryList(line, base_id, category_list): def getSortedCategoryList(line, base_id, category_list):
category_dict = {}
for category in category_list:
category_dict[category.split('/')[0]] = category
result = [] result = []
index_list = line.index[base_id].keys() index_list = line.index[base_id].keys()
index_list.sort() index_list.sort()
for index in index_list: for category in category_list:
if line.index[base_id][index]: for index in index_list:
base_category = line.index[base_id][index].keys()[0].split('/')[0] if line.index[base_id][index]:
result.append(category_dict[base_category]) if category in line.index[base_id][index]:
return result result.append((index, category))
result.sort()
return [category for index, category in result]
for cell_dict in cell_dict_list: for cell_dict in cell_dict_list:
base_id = cell_dict['base_id'] base_id = cell_dict['base_id']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment