| Line 254... |
Line 254... |
| 254 |
else:
|
254 |
else:
|
| 255 |
sku['bestSellerPoints'] = -100
|
255 |
sku['bestSellerPoints'] = -100
|
| 256 |
#sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
|
256 |
#sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
|
| 257 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints']}},multi=False)
|
257 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints']}},multi=False)
|
| 258 |
|
258 |
|
| 259 |
shortageSkus = list(get_mongo_connection().Catalog.Deals.find({"$and":[{'is_shortage': 1 }, { 'source_id' : { "$in": SOURCE_MAP.values() } }] }).distinct('_id'))
|
259 |
shortageSkus = get_mongo_connection().Catalog.MasterData.find({"$and":[{'is_shortage': 1 }, { 'source_id' : { "$in": SOURCE_MAP.values() } }] }).distinct('_id')
|
| - |
|
260 |
print "Shortage skus"
|
| - |
|
261 |
print shortageSkus
|
| 260 |
|
262 |
|
| 261 |
for sku in allItems:
|
263 |
for sku in allItems:
|
| 262 |
deal_item = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':sku['skuBundleId']}).sort('bestSellerPoints',pymongo.DESCENDING).limit(1))
|
264 |
deal_item = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':sku['skuBundleId']}).sort('bestSellerPoints',pymongo.DESCENDING).limit(1))
|
| 263 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
|
265 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
|
| 264 |
shortagePoints = 50 if sku['_id'] in shortageSkus else 0
|
266 |
shortagePoints = 50 if sku['_id'] in shortageSkus else 0
|