本文整理匯總了Python中app.model.DBSession.lot_current_user_id方法的典型用法代碼示例。如果您正苦於以下問題:Python DBSession.lot_current_user_id方法的具體用法?Python DBSession.lot_current_user_id怎麽用?Python DBSession.lot_current_user_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app.model.DBSession
的用法示例。
在下文中一共展示了DBSession.lot_current_user_id方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: checkOutLot
# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import lot_current_user_id [as 別名]
def checkOutLot(self,barcode,userId,pbarId=None):
retVal = {}
try:
lot = DBSession().query(ReagentLot).filter(ReagentLot.lot_barcode==barcode.strip()).one() #@UndefinedVariable : lot_barcode comes from SQLAlchemy reflection
lot.lot_current_user_id = int(userId)
retVal = {'success': "Successfully checked out " + lot.lot_barcode}
except Exception,e:
log.debug(e)
retVal = {'error': 'barcode ' + barcode + ' not found in inventory'}
示例2: disposeLot
# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import lot_current_user_id [as 別名]
def disposeLot(self,barcode,userId,pbarId=None):
retVal = {}
try:
lot = DBSession().query(ReagentLot).filter(ReagentLot.lot_barcode==barcode.strip()).one() #@UndefinedVariable : lot_barcode comes from SQLAlchemy reflection
lot.lot_is_disposed = 'Y'
lot.lot_current_user_id = None
retVal = {'success': 'Marked as disposed ' + lot.lot_barcode}
except Exception,e:
log.debug(e)
retVal = {'error': 'barcode ' + barcode + ' not found in inventory'}
示例3: link
# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import lot_current_user_id [as 別名]
def link(self,parentId,childBarcode):
retVal={'success': 'Successfully linked reagent'}
try:
child = DBSession().query(ReagentLot).filter(ReagentLot.lot_barcode==childBarcode).one()
child.loc = DBSession().query(ReagentLotLocation).get(parentId)
child.aud_modified_date = datetime.datetime.now()
child.lot_current_user_id = None
except Exception,e:
log.exception(e)
retVal={'error':"Could not find barcode " + childBarcode}
示例4: checkInLot
# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import lot_current_user_id [as 別名]
def checkInLot(self,barcode,userId,pbarId=None):
retVal = {}
msg = ''
try:
lot = DBSession().query(ReagentLot).filter(ReagentLot.lot_barcode==barcode.strip()).one() #@UndefinedVariable : lot_barcode comes from SQLAlchemy reflection
msg += ', place in <b>bin</b> ' + str(lot.loc.loc_name)
msg += ', <b>shelf</b> ' + str(lot.loc.loc_shelf)
msg += ', <b>cabinet</b> ' + str(lot.loc.loc_cabinet)
msg += ', <b>room</b> ' + str(lot.loc.loc_room)
if lot.lot_current_user_id == None:
retVal = {'error': lot.lot_barcode + ' already checked in ' + msg}
else:
lot.lot_current_user_id = None
retVal = {'success': lot.lot_barcode + ' has been checked in ' + msg}
except Exception,e:
log.debug(e)
retVal = {'error': 'barcode ' + barcode + ' not found in inventory'}