當前位置: 首頁>>代碼示例>>Python>>正文


Python DBSession.rxn_org_id方法代碼示例

本文整理匯總了Python中app.model.DBSession.rxn_org_id方法的典型用法代碼示例。如果您正苦於以下問題:Python DBSession.rxn_org_id方法的具體用法?Python DBSession.rxn_org_id怎麽用?Python DBSession.rxn_org_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app.model.DBSession的用法示例。


在下文中一共展示了DBSession.rxn_org_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: clone

# 需要導入模塊: from app.model import DBSession [as 別名]
# 或者: from app.model.DBSession import rxn_org_id [as 別名]
 def clone(self, owner=None):
     crxn = saClone(self)
     newRxn = DBSession().merge(crxn)
     newRxn.rxn_program_id = None
     newRxn.rxn_org_id = None
     newRxn.completed_by_id = None
     newRxn.date_completed = None
     newRxn.date_created = None
     newRxn.rxn_notebook_id = None
     newRxn.rxn_notebook_page = None
     newRxn.date_witnessed = None
     newRxn.witness_id = None
     newRxn.date_created = datetime.datetime.now()
     for reagent in self.reagents:
         newr = saClone(reagent)
         # Update stoich-to-protocol links
         newr.uuid = uuid.uuid4().hex
         newRxn.reagents.append(newr)
         if newRxn.rxn_protocol:
             newRxn.rxn_protocol = newRxn.rxn_protocol.replace(reagent.uuid, newr.uuid)
     for product in self.products:
         newp = saClone(product)
         # Update stoich-to-protocol links
         newp.uuid = uuid.uuid4().hex
         # Clear out things which can't be known until reaction is complete
         newp.amount = None
         newp.submitted_amount = None
         newp.pct_yield = None
         newp.purity = None
         newp.barcode = None
         newRxn.products.append(newp)
         if newRxn.rxn_protocol:
             newRxn.rxn_protocol = newRxn.rxn_protocol.replace(product.uuid, newp.uuid)
     newRxn.owner = owner
     return newRxn
開發者ID:aytsai,項目名稱:ricebowl,代碼行數:37,代碼來源:compounds.py


注:本文中的app.model.DBSession.rxn_org_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。