Subversion Repositories SmartDukaan

Rev

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

Rev 17658 Rev 17662
Line 376... Line 376...
376
            temp.append(temp_map)
376
            temp.append(temp_map)
377
            brandPrefMap[(x.brand).strip().upper()] = temp
377
            brandPrefMap[(x.brand).strip().upper()] = temp
378
        
378
        
379
    for x in session.query(user_actions).filter_by(user_id=userId).all():
379
    for x in session.query(user_actions).filter_by(user_id=userId).all():
380
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
380
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
381
    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)]))
381
    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, 'subCategoryId':1}).sort([('totalPoints',pymongo.DESCENDING),('bestSellerPoints',pymongo.DESCENDING),('nlcPoints',pymongo.DESCENDING),('rank',pymongo.DESCENDING)]))
382
    mobile_deals = []
382
    mobile_deals = []
383
    tablet_deals = []
383
    tablet_deals = []
384
    accessories_deals = []
384
    accessories_deals = []
385
    for deal in all_deals:
385
    for deal in all_deals:
386
        
386
        
Line 748... Line 748...
748
    
748
    
749
    
749
    
750
    for dealList in [rankMap.get(k, []) for k in range(offset, offset+limit)]:
750
    for dealList in [rankMap.get(k, []) for k in range(offset, offset+limit)]:
751
        if filterData is None:
751
        if filterData is None:
752
            while(True):
752
            while(True):
753
                print "Rank counter is ",rankCounter+1
-
 
754
                
-
 
755
                print fd_dealObject.get(category_id).get(rankCounter+1)
-
 
756
                
753
                
757
                rankCounter = rankCounter+1
754
                rankCounter = rankCounter+1
758
                if (fd_dealObject.get(category_id).get(rankCounter)) is not None:
755
                if (fd_dealObject.get(category_id).get(rankCounter)) is not None:
759
                    deal_object_temp = []
756
                    deal_object_temp = []
760
                    deal_object_temp.append(fd_dealObject.get(category_id).get(rankCounter).get('object'))
757
                    deal_object_temp.append(fd_dealObject.get(category_id).get(rankCounter).get('object'))