| Line 176... |
Line 176... |
| 176 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
176 |
catalogObj['create_timestamp'] = to_java_date(tag.create_timestamp)
|
| 177 |
catalogMap[item.catalog_item_id] = catalogObj
|
177 |
catalogMap[item.catalog_item_id] = catalogObj
|
| 178 |
|
178 |
|
| 179 |
catalogObj = catalogMap.get(item.catalog_item_id)
|
179 |
catalogObj = catalogMap.get(item.catalog_item_id)
|
| 180 |
|
180 |
|
| 181 |
catalogObj['hot_deals'] = tag.hot_deals
|
- |
|
| 182 |
if tag.active and not catalogObj['items'].has_key(item.id):
|
181 |
if not catalogObj['items'].has_key(item.id):
|
| 183 |
catalogObj['items'][item.id] = {'color': item.color.replace("f_", ""), 'tagPricing':[]}
|
182 |
catalogObj['items'][item.id] = {'color': item.color.replace("f_", ""), 'tagPricing':[]}
|
| 184 |
itemMap = catalogObj['items'].get(item.id)
|
183 |
itemMap = catalogObj['items'].get(item.id)
|
| 185 |
itemMap['tagPricing'].append(tag)
|
184 |
itemMap['tagPricing'].append(tag)
|
| 186 |
|
185 |
|
| 187 |
|
186 |
|
| Line 191... |
Line 190... |
| 191 |
itemObjs = []
|
190 |
itemObjs = []
|
| 192 |
for itemId, itemMap in itemsMap.iteritems():
|
191 |
for itemId, itemMap in itemsMap.iteritems():
|
| 193 |
tags = itemMap['tagPricing']
|
192 |
tags = itemMap['tagPricing']
|
| 194 |
for tag in tags:
|
193 |
for tag in tags:
|
| 195 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
194 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
| 196 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active}
|
195 |
'mrp_f':tag.mrp, 'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active, 'hot_deal_b': tag.hot_deal}
|
| 197 |
itemObjs.append(itemObj)
|
196 |
itemObjs.append(itemObj)
|
| 198 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
|
197 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
|
| 199 |
'hot_deals_b':catalogMap['hot_deals'],
|
- |
|
| 200 |
'_childDocuments_':itemObjs,
|
198 |
'_childDocuments_':itemObjs,
|
| 201 |
'child_b' : len(itemObjs) > 0,
|
199 |
'child_b' : len(itemObjs) > 0,
|
| 202 |
'catalogId_i':catalogId,
|
200 |
'catalogId_i':catalogId,
|
| 203 |
'imageUrl_s': catalogMap['imageUrl'].replace("saholic", "smartdukaan"),
|
201 |
'imageUrl_s': catalogMap['imageUrl'].replace("saholic", "smartdukaan"),
|
| 204 |
'feature_s':catalogMap['feature'],
|
202 |
'feature_s':catalogMap['feature'],
|