Subversion Repositories SmartDukaan

Rev

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

Rev 17779 Rev 17780
Line 55... Line 55...
55
    print bundleMap 
55
    print bundleMap 
56
                
56
                
57
 
57
 
58
def addItemIdInfo():
58
def addItemIdInfo():
59
    global bundleMap
59
    global bundleMap
60
    CatalogDataService.initialize(db_hostname=options.host,setup=False)
60
    CatalogDataService.initialize(db_hostname=options.hostname,setup=False)
61
    totalLength = len(bundleMap.keys())
61
    totalLength = len(bundleMap.keys())
62
    fetch =100
62
    fetch =100
63
    start = 0
63
    start = 0
64
    toBreak = False
64
    toBreak = False
65
    while(True):
65
    while(True):
Line 105... Line 105...
105
        mc.set(str("item_availability_"+str(k)), temp, 24*60*60)
105
        mc.set(str("item_availability_"+str(k)), temp, 24*60*60)
106
 
106
 
107
    
107
    
108
def fetchItemAvailablity():
108
def fetchItemAvailablity():
109
    global inventoryMap
109
    global inventoryMap
110
    InventoryDataService.initialize(db_hostname=options.host,setup=False)
110
    InventoryDataService.initialize(db_hostname=options.hostname,setup=False)
111
    allInventory = session.query(ItemAvailabilityCache).filter(ItemAvailabilityCache.sourceId==1).all()
111
    allInventory = session.query(ItemAvailabilityCache).filter(ItemAvailabilityCache.sourceId==1).all()
112
    for itemInventory in allInventory:
112
    for itemInventory in allInventory:
113
        inventoryMap[itemInventory.itemId] = itemInventory.totalAvailability
113
        inventoryMap[itemInventory.itemId] = itemInventory.totalAvailability
114
    session.close()
114
    session.close()
115
 
115