| Line 138... |
Line 138... |
| 138 |
tuples = session.query(Tag_Listing, Item).join((Item, Item.id==Tag_Listing.item_id)).filter(or_(Item.status==status.ACTIVE, Item.status==status.PAUSED_BY_RISK, Item.status==status.PARTIALLY_ACTIVE))
|
138 |
tuples = session.query(Tag_Listing, Item).join((Item, Item.id==Tag_Listing.item_id)).filter(or_(Item.status==status.ACTIVE, Item.status==status.PAUSED_BY_RISK, Item.status==status.PARTIALLY_ACTIVE))
|
| 139 |
projection={'defaultImageUrl':1}
|
139 |
projection={'defaultImageUrl':1}
|
| 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 tag.activate and not catalogMap.has_key(item.catalog_item_id):
|
| 144 |
catalogObj = {}
|
144 |
catalogObj = {}
|
| 145 |
catalogObj['feature'] = ""
|
145 |
catalogObj['feature'] = ""
|
| 146 |
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]))
|
| 147 |
catalogObj['brand'] = (item.brand)
|
147 |
catalogObj['brand'] = (item.brand)
|
| 148 |
if item.brand == 'Huawei' or item.brand == 'Honor':
|
148 |
if item.brand == 'Huawei' or item.brand == 'Honor':
|
| Line 170... |
Line 170... |
| 170 |
catalogObj['feature'] = featureMap.get(item.catalog_item_id)
|
170 |
catalogObj['feature'] = featureMap.get(item.catalog_item_id)
|
| 171 |
#Mobile and tablets are showcased in same category
|
171 |
#Mobile and tablets are showcased in same category
|
| 172 |
catalogObj['categoryId'] = 3 if item.category in [10006, 10009] else 6
|
172 |
catalogObj['categoryId'] = 3 if item.category in [10006, 10009] else 6
|
| 173 |
catalogObj['subCategoryId'] = item.category
|
173 |
catalogObj['subCategoryId'] = item.category
|
| 174 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
174 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
| 175 |
if tag.active:
|
- |
|
| 176 |
catalogMap[item.catalog_item_id] = catalogObj
|
- |
|
| 177 |
|
175 |
|
| 178 |
catalogObj = catalogMap.get(item.catalog_item_id)
|
176 |
catalogObj = catalogMap.get(item.catalog_item_id)
|
| 179 |
|
177 |
|
| 180 |
if tag.hot_deals:
|
178 |
if tag.hot_deals:
|
| 181 |
catalogObj['hot_deals'] = "True"
|
179 |
catalogObj['hot_deals'] = "True"
|