Subversion Repositories SmartDukaan

Rev

Rev 14828 | Rev 14834 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14828 Rev 14833
Line 343... Line 343...
343
    except:
343
    except:
344
        print "Unable to compute deal for ",item[0]['skuBundleId']
344
        print "Unable to compute deal for ",item[0]['skuBundleId']
345
    return info
345
    return info
346
 
346
 
347
def updatePriceForNotificationBundles(skuBundleId):
347
def updatePriceForNotificationBundles(skuBundleId):
348
    itemIds = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':skuBundleId,'priceUpdatedOn':{'$lte':to_java_date(datetime.now() - timedelta(minutes=3))}}))
348
    itemIds = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':skuBundleId,'priceUpdatedOn':{'$lte':to_java_date(datetime.now() - timedelta(minutes=3))},'source_id':{"$in":SOURCE_MAP.values()}}))
349
    for item in itemIds:
349
    for item in itemIds:
-
 
350
        print item['_id']
350
        item['dealFlag'] = 0
351
        item['dealFlag'] = 0
351
        item['dealType'] = 0
352
        item['dealType'] = 0
352
        manualDeals = list(get_mongo_connection().Catalog.ManualDeals.find({'startDate':{'$lte':to_java_date(datetime.now())},'endDate':{'$gte':to_java_date(datetime.now())},'source_id':item['source_id'], 'sku':item['_id']}))
353
        manualDeals = list(get_mongo_connection().Catalog.ManualDeals.find({'startDate':{'$lte':to_java_date(datetime.now())},'endDate':{'$gte':to_java_date(datetime.now())},'source_id':item['source_id'], 'sku':item['_id']}))
353
        if len(manualDeals) > 0:
354
        if len(manualDeals) > 0:
354
            item['dealFlag'] = 1
355
            item['dealFlag'] = 1
Line 362... Line 363...
362
    except:
363
    except:
363
        print "Unable to compute deal for ",skuBundleId
364
        print "Unable to compute deal for ",skuBundleId
364
 
365
 
365
 
366
 
366
def main():
367
def main():
367
    print "retuned %s"%(str(getLatestPrice(1420, 2)))
368
    print "retuned %s"%(str(getLatestPrice(2313, 1)))
368
 
369
 
369
if __name__=='__main__':
370
if __name__=='__main__':
370
    main()
371
    main()
371
    
372