Subversion Repositories SmartDukaan

Rev

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

Rev 14104 Rev 14105
Line 120... Line 120...
120
        deal['brand_weight'] = brand_weight
120
        deal['brand_weight'] = brand_weight
121
        deal['asp_weight'] = asp_weight
121
        deal['asp_weight'] = asp_weight
122
        deal['persPoints'] = persPoints
122
        deal['persPoints'] = persPoints
123
        
123
        
124
        all_category_deals.append(deal)
124
        all_category_deals.append(deal)
-
 
125
        
-
 
126
        print deal['_id']
-
 
127
        print deal['fav_weight']
-
 
128
        print deal['brand_weight']
-
 
129
        print deal['asp_weight']
-
 
130
        print deal['persPoints']
-
 
131
         
-
 
132
        print "==================="
125
    
133
    
126
    
134
    
127
    sorted_deals = sorted(all_category_deals, key = lambda x: (x['persPoints'],x['totalPoints'],x['bestSellerPoints'], x['nlcPoints'], x['rank']),reverse=True)
135
    sorted_deals = sorted(all_category_deals, key = lambda x: (x['persPoints'],x['totalPoints'],x['bestSellerPoints'], x['nlcPoints'], x['rank']),reverse=True)
128
    p = []
136
    p = []
129
    for x in sorted_deals:
137
    for x in sorted_deals:
130
        s_info = __SkuInfo(x['_id'], x['skuBundleId'], x['category_id'],x['mrp'],x['available_price'],x['source_id'],x['rank'],x['maxNlc'], \
138
        s_info = __SkuInfo(x['_id'], x['skuBundleId'], x['category_id'],x['mrp'],x['available_price'],x['source_id'],x['rank'],x['maxNlc'], \
131
                           x['minNlc'], x['schemeAmount'],x['minDiscount'],x['maxDiscount'],x['discountType'],x['dp'],x['nlcPoints'],x['bestSellerPoints'], \
139
                           x['minNlc'], x['schemeAmount'],x['minDiscount'],x['maxDiscount'],x['discountType'],x['dp'],x['nlcPoints'],x['bestSellerPoints'], \
132
                           x['totalPoints'],x['in_stock'],x['maxprice'],x['showDeal'],x['persPoints'],deal['fav_weight'],deal['brand_weight'],deal['asp_weight'])
140
                           x['totalPoints'],x['in_stock'],x['maxprice'],x['showDeal'],x['persPoints'],x['fav_weight'],x['brand_weight'],x['asp_weight'])
133
        p.append(s_info)
141
        p.append(s_info)
134
    
142
    
135
    
143
    
136
    wbk = xlwt.Workbook()
144
    wbk = xlwt.Workbook()
137
    sheet = wbk.add_sheet('User Deals')
145
    sheet = wbk.add_sheet('User Deals')
Line 244... Line 252...
244
        print "Error: unable to send email."
252
        print "Error: unable to send email."
245
 
253
 
246
    
254
    
247
 
255
 
248
def main():
256
def main():
249
    generateSheet(1)
257
    generateSheet(8)
250
 
258
 
251
if __name__=='__main__':
259
if __name__=='__main__':
252
    main()
260
    main()