本文整理匯總了Python中app.model.DBSession.lot_source_org_id方法的典型用法代碼示例。如果您正苦於以下問題:Python DBSession.lot_source_org_id方法的具體用法?Python DBSession.lot_source_org_id怎麽用?Python DBSession.lot_source_org_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app.model.DBSession
的用法示例。
在下文中一共展示了DBSession.lot_source_org_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import lot_source_org_id [as 別名]
from app.model import register
conv=OBConversion()
conv.SetOutFormat('mol')
from sqlalchemy import exists, not_
for row in r:
first=True
cid=None
pcid_cat=getCIDs(row['pcid_catno'])
pcid_cas=getCIDs(row['pcid_cas'])
pcid_name=getCIDs(row['pcid_name'])
lot=DBSession().query(ReagentBackload).filter(not_(exists().where(ReagentBackload.lot_barcode == ReagentLot.lot_barcode))).filter(ReagentBackload.lot_id == row['lot_id']).first()
if not lot:
continue
if not lot.lot_source_org_id:
lot.lot_source_org_id = 0
matches = 0 # haven't found any matches yet from candidate structures
matched=False
# Check catalog. If only one cid, use only that one.
if len(pcid_cat)==1:
cid=pcid_cat[0]
if lot.lot_mw and checkMw(lot, cid):
matched=True
mwBased += 1
else:
matched=True
if matched:
matches = 1
# Check cas. If only one, use it.