| Line 220... |
Line 220... |
| 220 |
sku['bestSellerPoints'] = -100
|
220 |
sku['bestSellerPoints'] = -100
|
| 221 |
sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
|
221 |
sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
|
| 222 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
|
222 |
get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
|
| 223 |
|
223 |
|
| 224 |
def elimiateSimilarDeals():
|
224 |
def elimiateSimilarDeals():
|
| 225 |
allItems = list(get_mongo_connection().Catalog.Deals.find())
|
225 |
allItems = get_mongo_connection().Catalog.Deals.find().distinct('skuBundleId')
|
| 226 |
for sku in allItems:
|
226 |
for skuBundleId in allItems:
|
| 227 |
print sku['_id']
|
227 |
print skuBundleId
|
| 228 |
similarItems = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':sku['skuBundleId']}).sort([('available_price',pymongo.ASCENDING)]))
|
228 |
similarItems = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':skuBundleId}).sort([('available_price',pymongo.ASCENDING)]))
|
| 229 |
bestSellerPoints = 0
|
- |
|
| 230 |
bestPrice = float("inf")
|
229 |
bestPrice = float("inf")
|
| 231 |
bestOne = None
|
230 |
bestOne = None
|
| 232 |
bestSellerPoints = 0
|
231 |
bestSellerPoints = 0
|
| 233 |
toUpdate = []
|
232 |
toUpdate = []
|
| 234 |
for similarItem in similarItems:
|
233 |
for similarItem in similarItems:
|