Subversion Repositories SmartDukaan

Rev

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

Rev 14105 Rev 14110
Line 84... Line 84...
84
        
84
        
85
    for x in session.query(user_actions).filter_by(user_id=userId).all():
85
    for x in session.query(user_actions).filter_by(user_id=userId).all():
86
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
86
        actionsMap[x.store_product_id] = 1 if x.action == 'like' else 0
87
    all_deals = list(get_mongo_connection().Catalog.Deals.find({"$and":outer_query}).sort([('totalPoints',pymongo.DESCENDING),('bestSellerPoints',pymongo.DESCENDING),('nlcPoints',pymongo.DESCENDING),('rank',pymongo.DESCENDING)]))
87
    all_deals = list(get_mongo_connection().Catalog.Deals.find({"$and":outer_query}).sort([('totalPoints',pymongo.DESCENDING),('bestSellerPoints',pymongo.DESCENDING),('nlcPoints',pymongo.DESCENDING),('rank',pymongo.DESCENDING)]))
88
    all_category_deals = []
88
    all_category_deals = []
-
 
89
    print actionsMap
-
 
90
    print brandPrefMap
-
 
91
    print pricePrefMap
89
    for deal in all_deals:
92
    for deal in all_deals:
90
        if actionsMap.get(deal['_id']) == 0:
93
        if actionsMap.get(deal['_id']) == 0:
91
            fav_weight =.25
94
            fav_weight =.25
92
        elif actionsMap.get(deal['_id']) == 1:
95
        elif actionsMap.get(deal['_id']) == 1:
93
            fav_weight = 1.5
96
            fav_weight = 1.5