| Line 262... |
Line 262... |
| 262 |
|
262 |
|
| 263 |
for sku in allItems:
|
263 |
for sku in allItems:
|
| 264 |
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))
|
| 265 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
|
265 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
|
| 266 |
shortagePoints = 50 if sku['_id'] in shortageSkus else 0
|
266 |
shortagePoints = 50 if sku['_id'] in shortageSkus else 0
|
| - |
|
267 |
print "Shortage points for ",sku['_id']
|
| - |
|
268 |
print shortagePoints
|
| 267 |
sku['totalPoints'] = sku['catalogBestSellerPoints'] + sku['nlcPoints'] + shortagePoints
|
269 |
sku['totalPoints'] = sku['catalogBestSellerPoints'] + sku['nlcPoints'] + shortagePoints
|
| 268 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'catalogBestSellerPoints':sku['catalogBestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
|
270 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'catalogBestSellerPoints':sku['catalogBestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
|
| 269 |
|
271 |
|
| 270 |
|
272 |
|
| 271 |
def populateNegativeDeals():
|
273 |
def populateNegativeDeals():
|