Subversion Repositories SmartDukaan

Rev

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

Rev 18186 Rev 18417
Line 83... Line 83...
83
                sellingPrice = d_item.sellingPrice
83
                sellingPrice = d_item.sellingPrice
84
                sellingPriceType = "Normal"
84
                sellingPriceType = "Normal"
85
                if d_privatedeal is not None and d_privatedeal.isActive==1 and d_privatedeal.startDate < datetime.now() and d_privatedeal.endDate > datetime.now() and d_privatedeal.dealPrice >0:
85
                if d_privatedeal is not None and d_privatedeal.isActive==1 and d_privatedeal.startDate < datetime.now() and d_privatedeal.endDate > datetime.now() and d_privatedeal.dealPrice >0:
86
                    sellingPrice = d_privatedeal.dealPrice
86
                    sellingPrice = d_privatedeal.dealPrice
87
                    sellingPriceType = "Private deal price"
87
                    sellingPriceType = "Private deal price"
88
                tempList.append({'item_id':d_item.id,'color':d_item.color,'sellingPrice':sellingPrice,'sellingPriceType':sellingPriceType,'minBuyQuantity':d_item.minimumBuyQuantity,'quantityStep':d_item.quantityStep})
88
                tempList.append({'item_id':d_item.id,'color':d_item.color,'sellingPrice':sellingPrice,'sellingPriceType':sellingPriceType,'minBuyQuantity':d_item.minimumBuyQuantity,'quantityStep':d_item.quantityStep,'maxQuantity':d_item.maximumBuyQuantity})
89
            if toBreak:
89
            if toBreak:
90
                print "Breaking"
90
                print "Breaking"
91
                break
91
                break
92
            start = fetch
92
            start = fetch
93
            fetch = start + fetch
93
            fetch = start + fetch
Line 100... Line 100...
100
            availability = inventoryMap.get(item.get('item_id'))
100
            availability = inventoryMap.get(item.get('item_id'))
101
            if availability is None:
101
            if availability is None:
102
                availability = 0
102
                availability = 0
103
            item['availability'] = availability
103
            item['availability'] = availability
104
            if availability < maxQuantity:
104
            if availability < maxQuantity:
105
                item['maxQuantity'] = availability
105
                temp_maxQuantity = availability
106
            else:
106
            else:
107
                item['maxQuantity'] = maxQuantity
107
                temp_maxQuantity = maxQuantity
-
 
108
        if temp_maxQuantity < item.get('maxQuantity') or item.get('maxQuantity') is None or item.get('maxQuantity')==0:
-
 
109
            item['maxQuantity'] = temp_maxQuantity
108
        temp = sorted(v, key = lambda x: (x['availability']),reverse=True)
110
        temp = sorted(v, key = lambda x: (x['availability']),reverse=True)
109
        mc = get_memcache_connection(host=options.mongoHost)
111
        mc = get_memcache_connection(host=options.mongoHost)
110
        mc.set(str("item_availability_"+str(k)), temp, 60*60)
112
        mc.set(str("item_availability_"+str(k)), temp, 60*60)
111
 
113
 
112
def flagNoAvailableItems():
114
def flagNoAvailableItems():