Subversion Repositories SmartDukaan

Rev

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

Rev 16450 Rev 16457
Line 324... Line 324...
324
            temp.append(temp_map)
324
            temp.append(temp_map)
325
            brandPrefMap[(x.brand).strip().upper()] = temp
325
            brandPrefMap[(x.brand).strip().upper()] = temp
326
        
326
        
327
    for x in session.query(user_actions).filter_by(user_id=userId).all():
327
    for x in session.query(user_actions).filter_by(user_id=userId).all():
328
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
328
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
329
    all_deals = list(get_mongo_connection().Catalog.Deals.find({"$and":outer_query},{'_id':1,'category_id':1,'brand':1,'totalPoints':1,'bestSellerPoints':1,'nlcPoints':1,'rank':1,'available_price':1,'dealType':1,'source_id':1,'brand_id':1,'skuBundleId':1,'dp':1, 'showDp':1}).sort([('totalPoints',pymongo.DESCENDING),('bestSellerPoints',pymongo.DESCENDING),('nlcPoints',pymongo.DESCENDING),('rank',pymongo.DESCENDING)]))
329
    all_deals = list(get_mongo_connection().Catalog.Deals.find({"$and":outer_query},{'_id':1,'category_id':1,'brand':1,'totalPoints':1,'bestSellerPoints':1,'nlcPoints':1,'rank':1,'available_price':1,'dealType':1,'source_id':1,'brand_id':1,'skuBundleId':1,'dp':1, 'showDp':1,'gross_price':1}).sort([('totalPoints',pymongo.DESCENDING),('bestSellerPoints',pymongo.DESCENDING),('nlcPoints',pymongo.DESCENDING),('rank',pymongo.DESCENDING)]))
330
    all_category_deals = []
330
    all_category_deals = []
331
    mobile_deals = []
331
    mobile_deals = []
332
    tablet_deals = []
332
    tablet_deals = []
333
    for deal in all_deals:
333
    for deal in all_deals:
334
        if actionsMap.get(deal['_id']) == 0:
334
        if actionsMap.get(deal['_id']) == 0:
Line 1329... Line 1329...
1329
        orders = get_mongo_connection().Catalog.MasterData.find_one({'skuBundleId':sku})
1329
        orders = get_mongo_connection().Catalog.MasterData.find_one({'skuBundleId':sku})
1330
        if orders is None:
1330
        if orders is None:
1331
            return {}
1331
            return {}
1332
        return orders
1332
        return orders
1333
    
1333
    
-
 
1334
    
-
 
1335
    
1334
def main():
1336
def main():
1335
    print getDealsForNotification("1,2,34,5")
1337
    print getDealsForNotification("1,2,34,5")
1336
    
1338
    
1337
    
1339
    
1338
    
1340