本文整理汇总了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'}