Subversion Repositories SmartDukaan

Rev

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

Rev 15379 Rev 15459
Line 1198... Line 1198...
1198
      
1198
      
1199
        mc.set("brandFilter",{0:brandMap, 3:mobData, 5:tabData}, 600)  
1199
        mc.set("brandFilter",{0:brandMap, 3:mobData, 5:tabData}, 600)  
1200
    
1200
    
1201
    return sorted(mc.get("brandFilter").get(category_id), key = lambda x: (-x['count'], x['brand']))
1201
    return sorted(mc.get("brandFilter").get(category_id), key = lambda x: (-x['count'], x['brand']))
1202
 
1202
 
1203
def getStaticDeals(offset, limit, category_id):
1203
def getStaticDeals(offset, limit, category_id, direction):
1204
    user_specific_deals = mc.get("staticDeals")
1204
    user_specific_deals = mc.get("staticDeals")
1205
    if user_specific_deals is None:
1205
    if user_specific_deals is None:
1206
        __populateStaticDeals()
1206
        __populateStaticDeals()
1207
        user_specific_deals = mc.get("staticDeals")
1207
        user_specific_deals = mc.get("staticDeals")
-
 
1208
    rev = False
-
 
1209
    if direction is None or direction == -1:
-
 
1210
        rev=True
1208
    return (user_specific_deals.get(category_id))[offset:offset+limit]
1211
    return sorted((user_specific_deals.get(category_id))[offset:offset+limit],reverse=rev)
1209
 
1212
 
1210
def __populateStaticDeals():
1213
def __populateStaticDeals():
1211
    print "Populating memcache for static deals"
1214
    print "Populating memcache for static deals"
1212
    outer_query = []
1215
    outer_query = []
1213
    outer_query.append({"showDeal":1})
1216
    outer_query.append({"showDeal":1})