Subversion Repositories SmartDukaan

Rev

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

Rev 17469 Rev 17541
Line 347... Line 347...
347
    
347
    
348
    fd_bundles = []
348
    fd_bundles = []
349
    
349
    
350
    for catMap in featuredDeals.itervalues():
350
    for catMap in featuredDeals.itervalues():
351
        for fd_map in catMap.itervalues():
351
        for fd_map in catMap.itervalues():
-
 
352
            if not fd_map.get('skuBundleId') in fd_bundles:
352
            fd_bundles.append(fd_map.get('skuBundleId'))
353
                fd_bundles.append(fd_map.get('skuBundleId'))
353
    
354
    
354
    print "Populating memcache for userId",userId
355
    print "Populating memcache for userId",userId
355
    outer_query = []
356
    outer_query = []
356
    outer_query.append({ "$or": [ { "showDeal": 1} , { "prepaidDeal": 1 } ] })
357
    outer_query.append({ "$or": [ { "showDeal": 1} , { "prepaidDeal": 1 } ] })
357
    query = {}
358
    query = {}
Line 652... Line 653...
652
#                     featuredDealsTablets[activeFeaturedDeal.get('rank')] = f_deal
653
#                     featuredDealsTablets[activeFeaturedDeal.get('rank')] = f_deal
653
#                 break
654
#                 break
654
                
655
                
655
        
656
        
656
    mc.set("featured_deals", {3:featuredDealsMobiles,5:featuredDealsTablets,6:featuredDealsAccessories}, 600)
657
    mc.set("featured_deals", {3:featuredDealsMobiles,5:featuredDealsTablets,6:featuredDealsAccessories}, 600)
657
    print mc.get("featured_deals")
-
 
658
 
658
 
659
def getNewDeals(userId, category_id, offset, limit, sort, direction, filterData=None):
659
def getNewDeals(userId, category_id, offset, limit, sort, direction, filterData=None):
660
    if mc.get("category_cash_back") is None or not bool(mc.get("category_cash_back")):
660
    if mc.get("category_cash_back") is None or not bool(mc.get("category_cash_back")):
661
        populateCashBack()
661
        populateCashBack()
662
    
662
    
Line 2064... Line 2064...
2064
def main():
2064
def main():
2065
    featuredDeals = mc.get("featured_deals")
2065
    featuredDeals = mc.get("featured_deals")
2066
    print resetCache("47")
2066
    print resetCache("47")
2067
    print datetime.now()
2067
    print datetime.now()
2068
    x=  getNewDeals(47, 6, 0, 20, None, None, None)
2068
    x=  getNewDeals(47, 6, 0, 20, None, None, None)
2069
    for y in x:
-
 
2070
        print y[0]['skuBundleId'],
2069
    from bson.json_util import dumps
2071
        print '\t',
2070
    print dumps(x)
2072
        print y[0]['brand']
-
 
2073
    print datetime.now()
2071
    print datetime.now()
2074
 
2072
 
2075
        
2073
        
2076
 
2074
 
2077
if __name__=='__main__':
2075
if __name__=='__main__':