Subversion Repositories SmartDukaan

Rev

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

Rev 22258 Rev 22261
Line 1164... Line 1164...
1164
            temp = sorted(temp, key = lambda x: (x['available_price']),reverse=False)
1164
            temp = sorted(temp, key = lambda x: (x['available_price']),reverse=False)
1165
        dealsListMap.append(temp)
1165
        dealsListMap.append(temp)
1166
    return dealsListMap
1166
    return dealsListMap
1167
 
1167
 
1168
 
1168
 
1169
def getAccesoryDeals(userId, category_id, offset, limit, sort, direction, filterData=None, source="all", tag_ids=None):
1169
def getAccesoryDeals(userId, category_id, offset, limit, sort, direction, filterData=None, source=None, tag_ids=None):
1170
    if mc.get("category_cash_back") is None or not bool(mc.get("category_cash_back")):
1170
    if mc.get("category_cash_back") is None or not bool(mc.get("category_cash_back")):
1171
        populateCashBack()
1171
        populateCashBack()
1172
    
1172
    
1173
    dealsListMap = []
1173
    dealsListMap = []
1174
    user_specific_deals = mc.get(str(userId)+'_acc')
1174
    user_specific_deals = mc.get(str(userId)+'_acc')
Line 1179... Line 1179...
1179
        print "Getting user deals from accessory cache"
1179
        print "Getting user deals from accessory cache"
1180
    category_specific_deals = user_specific_deals.get(category_id)
1180
    category_specific_deals = user_specific_deals.get(category_id)
1181
    
1181
    
1182
    #filter categores on basis of source and tags
1182
    #filter categores on basis of source and tags
1183
    if source=="online":
1183
    if source=="online":
1184
        category_specific_deals = filter(lambda x: x['souce_id'] in ONLINE_DEAL_SOURCE_MAP, category_specific_deals)
1184
        category_specific_deals = filter(lambda x: x['source_id'] in ONLINE_DEAL_SOURCE_MAP, category_specific_deals)
1185
    elif source=="deals":
1185
    elif source=="deals":
1186
        category_specific_deals = filter(lambda x: x['souce_id'] == SOURCE_MAP.get("SAHOLIC"), category_specific_deals)
1186
        category_specific_deals = filter(lambda x: x['source_id'] == SOURCE_MAP.get("SAHOLIC"), category_specific_deals)
1187
    
1187
    
1188
    insert_featured_deals = False
1188
    insert_featured_deals = False
1189
    if sort is None or direction is None:
1189
    if sort is None or direction is None:
1190
        insert_featured_deals = True
1190
        insert_featured_deals = True
1191
        rankMap = user_specific_deals.get(str(category_id)+"_rankMap")
1191
        rankMap = user_specific_deals.get(str(category_id)+"_rankMap")