| Line 122... |
Line 122... |
| 122 |
else:
|
122 |
else:
|
| 123 |
return obj
|
123 |
return obj
|
| 124 |
|
124 |
|
| 125 |
|
125 |
|
| 126 |
def populateTagItems():
|
126 |
def populateTagItems():
|
| 127 |
|
- |
|
| 128 |
|
- |
|
| 129 |
tagRankingList = session.query(Tag_Ranking).order_by(desc(Tag_Ranking.rankPoints)).all()
|
127 |
tagRankingList = session.query(Tag_Ranking).order_by(desc(Tag_Ranking.rankPoints)).all()
|
| 130 |
rankingList = []
|
128 |
rankingList = []
|
| 131 |
featureMap = {}
|
129 |
featureMap = {}
|
| 132 |
for tagRanking in tagRankingList:
|
130 |
for tagRanking in tagRankingList:
|
| 133 |
rankingList.append(tagRanking.catalogItemId)
|
131 |
rankingList.append(tagRanking.catalogItemId)
|
| Line 195... |
Line 193... |
| 195 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
193 |
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}
|
194 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price}
|
| 197 |
itemObjs.append(itemObj)
|
195 |
itemObjs.append(itemObj)
|
| 198 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],'hot_deals_b':catalogMap['hot_deals'],
|
196 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],'hot_deals_b':catalogMap['hot_deals'],
|
| 199 |
'_childDocuments_':itemObjs,
|
197 |
'_childDocuments_':itemObjs,
|
| 200 |
'catalogId_i':catalogId, 'imageUrl_s': catalogMap['imageUrl'], 'feature_s':catalogMap['feature'],
|
198 |
'catalogId_i':catalogId, 'imageUrl_s': catalogMap['imageUrl'].replace("saholic", "smartdukaan"), 'feature_s':catalogMap['feature'],
|
| 201 |
'brand_ss': catalogMap['brand'], 'create_s':catalogMap['create_timestamp'], 'categoryId_i':catalogMap['categoryId'], 'subCategoryId_i':catalogMap['subCategoryId']}
|
199 |
'brand_ss': catalogMap['brand'], 'create_s':catalogMap['create_timestamp'], 'categoryId_i':catalogMap['categoryId'], 'subCategoryId_i':catalogMap['subCategoryId']}
|
| 202 |
print catalogObj
|
200 |
print catalogObj
|
| 203 |
catalogObjs.append(catalogObj)
|
201 |
catalogObjs.append(catalogObj)
|
| 204 |
solr.delete(q='*:*')
|
202 |
solr.delete(q='*:*')
|
| 205 |
solr.add(catalogObjs)
|
203 |
solr.add(catalogObjs)
|
| 206 |
|
204 |
|
| 207 |
|
- |
|
| 208 |
|
- |
|
| 209 |
|
205 |
|
| 210 |
|
206 |
|
| 211 |
#items = Item.query.filter(Item.risky==True).filter(or_(Item.status==status.ACTIVE)).all()
|
207 |
#items = Item.query.filter(Item.risky==True).filter(or_(Item.status==status.ACTIVE)).all()
|
| 212 |
# global con
|
208 |
# global con
|
| 213 |
# if con is None:
|
209 |
# if con is None:
|