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