| Line 140... |
Line 140... |
| 140 |
for tag, item in tuples:
|
140 |
for tag, item in tuples:
|
| 141 |
if item.brand == "Live Demo":
|
141 |
if item.brand == "Live Demo":
|
| 142 |
continue
|
142 |
continue
|
| 143 |
if not catalogMap.has_key(item.catalog_item_id):
|
143 |
if not catalogMap.has_key(item.catalog_item_id):
|
| 144 |
catalogObj = {}
|
144 |
catalogObj = {}
|
| - |
|
145 |
catalogObj['feature'] = ""
|
| 145 |
catalogObj['title'] = " ".join(filter(None, [item.brand, item.model_name, item.model_number]))
|
146 |
catalogObj['title'] = " ".join(filter(None, [item.brand, item.model_name, item.model_number]))
|
| 146 |
catalogObj['brand'] = (item.brand)
|
147 |
catalogObj['brand'] = (item.brand)
|
| 147 |
if item.brand == 'Huawei' or item.brand == 'Honor':
|
148 |
if item.brand == 'Huawei' or item.brand == 'Honor':
|
| 148 |
catalogObj['brand'] = ('Huawei', 'Honor')
|
149 |
catalogObj['brand'] = ('Huawei', 'Honor')
|
| 149 |
catalogObj['identifier'] = item.catalog_item_id
|
150 |
catalogObj['identifier'] = item.catalog_item_id
|
| Line 163... |
Line 164... |
| 163 |
catalogObj['rank'] = rankingList.index(item.catalog_item_id)
|
164 |
catalogObj['rank'] = rankingList.index(item.catalog_item_id)
|
| 164 |
except:
|
165 |
except:
|
| 165 |
#A very big number
|
166 |
#A very big number
|
| 166 |
traceback.print_exc()
|
167 |
traceback.print_exc()
|
| 167 |
catalogObj['rank'] = 50000000
|
168 |
catalogObj['rank'] = 50000000
|
| 168 |
if featureMap.has_key(item.catalog_item_id):
|
- |
|
| 169 |
if featureMap.get(item.catalog_item_id) is None:
|
169 |
if featureMap.has_key(item.catalog_item_id) and featureMap.get(item.catalog_item_id) is not None:
|
| 170 |
catalogObj['feature'] = ""
|
- |
|
| 171 |
else:
|
- |
|
| 172 |
catalogObj['feature'] = featureMap.get(item.catalog_item_id)
|
170 |
catalogObj['feature'] = featureMap.get(item.catalog_item_id)
|
| 173 |
else:
|
- |
|
| 174 |
catalogObj['feature'] = ""
|
- |
|
| 175 |
#Mobile and tablets are showcased in same category
|
171 |
#Mobile and tablets are showcased in same category
|
| 176 |
catalogObj['categoryId'] = 3 if item.category in [10006, 10009] else 6
|
172 |
catalogObj['categoryId'] = 3 if item.category in [10006, 10009] else 6
|
| 177 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
173 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
| 178 |
catalogMap[item.catalog_item_id] = catalogObj
|
174 |
catalogMap[item.catalog_item_id] = catalogObj
|
| 179 |
|
175 |
|