Commit b35257f8 authored by haowang's avatar haowang

fix code

parent 6522610b
......@@ -26,12 +26,13 @@ class BrandListView(APIView):
category_infos = self.rpc['neptune/commodity/category/infos'](brand_ids=brand_ids).unwrap()
category_dict = {}
for obj in category_infos:
obj_id = obj.get('brand_id')
if category_dict.get(str(obj_id)):
category_dict.get(str(obj_id)).append(obj)
else:
category_dict[str(obj_id)] = [obj]
if category_infos:
for obj in category_infos:
obj_id = obj.get('brand_id')
if category_dict.get(str(obj_id)):
category_dict.get(str(obj_id)).append(obj)
else:
category_dict[str(obj_id)] = [obj]
classify_infos = self.rpc['neptune/commodity/classify/infos'](brand_ids=brand_ids).unwrap()
classify_dict = {str(obj.get('brand_id')): obj for obj in classify_infos}
......
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