| Line 53... |
Line 53... |
| 53 |
data = get_mongo_connection().Catalog.Deals.find().sort([('totalPoints',pymongo.DESCENDING)])
|
53 |
data = get_mongo_connection().Catalog.Deals.find().sort([('totalPoints',pymongo.DESCENDING)])
|
| 54 |
print data.count()
|
54 |
print data.count()
|
| 55 |
for x in data:
|
55 |
for x in data:
|
| 56 |
if x['source_id'] == 5 and x['rank'] ==0:
|
56 |
if x['source_id'] == 5 and x['rank'] ==0:
|
| 57 |
continue
|
57 |
continue
|
| 58 |
try:
|
- |
|
| 59 |
s_info = __SkuInfo(x['_id'], x['skuBundleId'], x['category_id'],x['mrp'],x['available_price'],x['source_id'],x['rank'],x['maxNlc'], \
|
58 |
s_info = __SkuInfo(x['_id'], x['skuBundleId'], x['category_id'],x['mrp'],x['available_price'],x['source_id'],x['rank'],x['maxNlc'], \
|
| 60 |
x['minNlc'], x['schemeAmount'],x['minDiscount'],x['maxDiscount'],x['discountType'],x['dp'],x['nlcPoints'],x['bestSellerPoints'], \
|
59 |
x['minNlc'], x['schemeAmount'],x['minDiscount'],x['maxDiscount'],x['discountType'],x['dp'],x['nlcPoints'],x['bestSellerPoints'], \
|
| 61 |
x['totalPoints'],x['in_stock'],x['maxprice'],x['showDeal'],x['catalogBestSellerPoints'],x['prepaidDeal'])
|
60 |
x['totalPoints'],x['in_stock'],x['maxprice'],x['showDeal'],x['catalogBestSellerPoints'],x['prepaidDeal'])
|
| 62 |
except:
|
- |
|
| 63 |
print 'Error Comes for Sku Id :- ', x['_id']
|
- |
|
| 64 |
print traceback.print_exc()
|
- |
|
| 65 |
p.append(s_info)
|
61 |
p.append(s_info)
|
| 66 |
|
62 |
|
| 67 |
wbk = xlwt.Workbook()
|
63 |
wbk = xlwt.Workbook()
|
| 68 |
sheet = wbk.add_sheet('Deals')
|
64 |
sheet = wbk.add_sheet('Deals')
|
| 69 |
xstr = lambda s: s or ""
|
65 |
xstr = lambda s: s or ""
|