Subversion Repositories SmartDukaan

Rev

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

Rev 14391 Rev 14429
Line 33... Line 33...
33
now = datetime.now()
33
now = datetime.now()
34
 
34
 
35
class __SkuInfo:
35
class __SkuInfo:
36
    
36
    
37
    def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
37
    def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
38
                 maxDiscount, discountType, dp, nlcPoints, bestSellerPoints, totalPoints, status, in_stock, maxprice, brand, dealType, dealPoints):
38
                 maxDiscount, discountType, dp, nlcPoints, status, in_stock, maxprice, brand, dealType, dealPoints):
39
        self._id = _id
39
        self._id = _id
40
        self.skuBundleId = skuBundleId
40
        self.skuBundleId = skuBundleId
41
        self.category_id = category_id
41
        self.category_id = category_id
42
        self.mrp = mrp
42
        self.mrp = mrp
43
        self.available_price = available_price
43
        self.available_price = available_price
Line 49... Line 49...
49
        self.minDiscount = minDiscount
49
        self.minDiscount = minDiscount
50
        self.maxDiscount = maxDiscount
50
        self.maxDiscount = maxDiscount
51
        self.discountType = discountType
51
        self.discountType = discountType
52
        self.dp = dp
52
        self.dp = dp
53
        self.nlcPoints = nlcPoints
53
        self.nlcPoints = nlcPoints
54
        self.bestSellerPoints = bestSellerPoints
-
 
55
        self.totalPoints = totalPoints
-
 
56
        self.status = status
54
        self.status = status
57
        self.in_stock = in_stock
55
        self.in_stock = in_stock
58
        self.maxprice = maxprice
56
        self.maxprice = maxprice
59
        self.brand = brand
57
        self.brand = brand
60
        self.dealType = dealType
58
        self.dealType = dealType
Line 86... Line 84...
86
        #topSkus = collection.find( {'_id':664})
84
        #topSkus = collection.find( {'_id':664})
87
        for sku in topSkus:
85
        for sku in topSkus:
88
            """Fix this """
86
            """Fix this """
89
            #TODO Compute deal flags else where.
87
            #TODO Compute deal flags else where.
90
            info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
88
            info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
91
                             None, None, None, None, None, None, sku['status'], sku['in_stock'],None,sku['brand'].strip().upper(), 0, 0)
89
                             None, None, None, None, sku['status'], sku['in_stock'],None,sku['brand'].strip().upper(), 0, 0)
92
            exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'sku':info._id}, {'overrideNlc':1} ]} ))
90
            exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'sku':info._id}, {'overrideNlc':1} ]} ))
93
            if len(exceptionalNlc) > 0:
91
            if len(exceptionalNlc) > 0:
94
                """Exceptional nlc found, no need to calculate max and min R-nlc"""
92
                """Exceptional nlc found, no need to calculate max and min R-nlc"""
95
                info.maxNlc = exceptionalNlc[0]['maxNlc']
93
                info.maxNlc = exceptionalNlc[0]['maxNlc']
96
                info.minNlc = exceptionalNlc[0]['minNlc']
94
                info.minNlc = exceptionalNlc[0]['minNlc']