| Line 45... |
Line 45... |
| 45 |
return None
|
45 |
return None
|
| 46 |
return memCon
|
46 |
return memCon
|
| 47 |
|
47 |
|
| 48 |
def populateSaholicBundles():
|
48 |
def populateSaholicBundles():
|
| 49 |
global bundleMap
|
49 |
global bundleMap
|
| 50 |
allSaholicBundles = get_mongo_connection(host=options.mongoHost).Catalog.MasterData.find({'source_id':SOURCE_MAP.get('SAHOLIC')})
|
50 |
allSaholicBundles = get_mongo_connection(host=options.mongoHost).Catalog.MasterData.find({'source_id':SOURCE_MAP.get('SAHOLIC'),'category_id':{"$in":[3,5,6]}})
|
| 51 |
for item in allSaholicBundles:
|
51 |
for item in allSaholicBundles:
|
| 52 |
try:
|
52 |
try:
|
| 53 |
if item.get('identifier') is not None or item.get('identifier').strip()!="":
|
53 |
if item.get('identifier') is not None or item.get('identifier').strip()!="":
|
| 54 |
#validItems.append({'_id':item.get('_id'),'catalog_item_id':long(item.get('identifier'))})
|
54 |
#validItems.append({'_id':item.get('_id'),'catalog_item_id':long(item.get('identifier'))})
|
| 55 |
bundleMap[long(item.get('identifier'))] = []
|
55 |
bundleMap[long(item.get('identifier'))] = []
|
| Line 118... |
Line 118... |
| 118 |
checkBulkPrices(item)
|
118 |
checkBulkPrices(item)
|
| 119 |
item['bulkPricing'] = sorted(item['bulkPricing'], key=lambda k: k['quantity'],reverse=False)
|
119 |
item['bulkPricing'] = sorted(item['bulkPricing'], key=lambda k: k['quantity'],reverse=False)
|
| 120 |
|
120 |
|
| 121 |
temp = sorted(v, key = lambda x: (x['availability']),reverse=True)
|
121 |
temp = sorted(v, key = lambda x: (x['availability']),reverse=True)
|
| 122 |
mc = get_memcache_connection(host=options.mongoHost)
|
122 |
mc = get_memcache_connection(host=options.mongoHost)
|
| - |
|
123 |
if k==1017958:
|
| - |
|
124 |
temp = [{'minBuyQuantity': 1L, 'color': '', 'quantityStep': 1L, 'sellingPriceType': 'Private deal price', 'maxQuantity': 1L, 'item_id': 24070L, 'sellingPrice': 395, 'availability': 1L, 'bulkPricing': [{'price': 395.0, 'quantity': 1}]}]
|
| - |
|
125 |
|
| 123 |
mc.set(str("item_availability_"+str(k)), temp, 60*60)
|
126 |
mc.set(str("item_availability_"+str(k)), temp, 60*60)
|
| 124 |
|
127 |
|
| 125 |
def checkBulkPrices(item):
|
128 |
def checkBulkPrices(item):
|
| 126 |
adjusted = False
|
129 |
adjusted = False
|
| 127 |
"""Lets check minBuyQty exist in bulkPricing"""
|
130 |
"""Lets check minBuyQty exist in bulkPricing"""
|