Subversion Repositories SmartDukaan

Rev

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

Rev 14037 Rev 14038
Line 335... Line 335...
335
    dealsMap = {}
335
    dealsMap = {}
336
    user_specific_deals = mc.get(str(userId))
336
    user_specific_deals = mc.get(str(userId))
337
    if user_specific_deals is None:
337
    if user_specific_deals is None:
338
        __populateCache(userId)
338
        __populateCache(userId)
339
        user_specific_deals = mc.get(str(userId))
339
        user_specific_deals = mc.get(str(userId))
-
 
340
    else:
-
 
341
        print "Getting user deals from cache"
340
    category_specific_deals = user_specific_deals.get(category_id)
342
    category_specific_deals = user_specific_deals.get(category_id)
341
    
343
    
342
    if sort is None or direction is None:
344
    if sort is None or direction is None:
343
        sorted_deals = sorted(category_specific_deals, key = lambda x: (x['persPoints'],x['totalPoints'],x['bestSellerPoints'], x['nlcPoints'], x['rank']),reverse=True)
345
        sorted_deals = sorted(category_specific_deals, key = lambda x: (x['persPoints'],x['totalPoints'],x['bestSellerPoints'], x['nlcPoints'], x['rank']),reverse=True)
344
    else:
346
    else:
Line 524... Line 526...
524
    except:
526
    except:
525
        return {0:"Data not updated."}
527
        return {0:"Data not updated."}
526
 
528
 
527
 
529
 
528
def main():
530
def main():
529
    x = getNewDeals(1, 0, 0, 30, None, None)
531
    x = getNewDeals(1, 0, 0, 500, None, None)
530
    for i in x:
532
    for i in x:
531
        print i['_id'],
533
        print i['_id'],
532
        print '\t',
534
        print '\t',
533
        print i['persPoints']
535
        print i['persPoints']
534
    
536