Subversion Repositories SmartDukaan

Rev

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

Rev 1368 Rev 1399
Line 44... Line 44...
44
def get_items_by_catalog_id(catalog_id):
44
def get_items_by_catalog_id(catalog_id):
45
    query = Item.query.filter_by(catalog_item_id=catalog_id)
45
    query = Item.query.filter_by(catalog_item_id=catalog_id)
46
    try:
46
    try:
47
        items = query.all()
47
        items = query.all()
48
        return get_thrift_item_list(items)
48
        return get_thrift_item_list(items)
-
 
49
    except Exception as ex:
49
    except:
50
        print ex
50
        raise InventoryServiceException(109, "Item not found")
51
        raise InventoryServiceException(109, "Item not found")
51
        
52
        
52
def is_active(item_id):
53
def is_active(item_id):
53
    try:
54
    try:
54
        item = get_item(item_id)
55
        item = get_item(item_id)
Line 566... Line 567...
566
        raise InventoryServiceException(111, "Missing pricing information for Vendor: " + vendor.name + " and Item: " + str(item_id))
567
        raise InventoryServiceException(111, "Missing pricing information for Vendor: " + vendor.name + " and Item: " + str(item_id))
567
 
568
 
568
def close_session():
569
def close_session():
569
    if session.is_active:
570
    if session.is_active:
570
        print "session is active. closing it."
571
        print "session is active. closing it."
571
        session.close()
-
 
572
572
        session.close()
-
 
573