当前位置: 首页>>代码示例>>Python>>正文


Python Session.execute方法代码示例

本文整理汇总了Python中qtools.model.Session.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Session.execute方法的具体用法?Python Session.execute怎么用?Python Session.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtools.model.Session的用法示例。


在下文中一共展示了Session.execute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __setup_db_context

# 需要导入模块: from qtools.model import Session [as 别名]
# 或者: from qtools.model.Session import execute [as 别名]
    def __setup_db_context(self, well_id):
        c.well = Session.query(QLBWell).filter_by(id=well_id)\
                         .options(joinedload_all(QLBWell.channels, innerjoin=True),
                                  joinedload_all(QLBWell.plate, QLBPlate.plate)).first()
        if not c.well:
            abort(404)
        
        c.reprocess_config_id = self.form_result['reprocess_config_id']
        c.analysis_group_id = self.form_result['analysis_group_id']
        # check for thing in relational table
        if c.reprocess_config_id and c.analysis_group_id:
            rec = Session.execute(select([agr]).where(and_(agr.c.analysis_group_id==int(c.analysis_group_id),
                                                           agr.c.reprocess_config_id==int(c.reprocess_config_id))))
            # check for an existing record
            if rec.rowcount > 0:
                # awesome, get the reprocess config name
                c.reprocess_config = Session.query(ReprocessConfig).get(c.reprocess_config_id)
                c.analysis_group = Session.query(AnalysisGroup).get(c.analysis_group_id)

                # get the plate metric for the plate
                c.well_metric = Session.query(WellMetric)\
                                        .join(PlateMetric)\
                                        .filter(and_(WellMetric.well_id==c.well.id,
                                                     PlateMetric.reprocess_config_id==c.reprocess_config_id))\
                                        .options(joinedload_all(WellMetric.well_channel_metrics, innerjoin=True)).first()
            else:
                c.reprocess_config = None
                c.analysis_group = None
        else:
            c.reprocess_config = None
            c.analysis_group = None
        
        if not c.reprocess_config:
            # try to find an existing well metric
            c.well_metric = Session.query(WellMetric)\
                                   .join(PlateMetric)\
                                   .filter(and_(WellMetric.well_id==c.well.id,
                                                PlateMetric.reprocess_config_id==None))\
                                   .options(joinedload_all(WellMetric.well_channel_metrics, innerjoin=True)).first()

        if not c.well_metric:
            c.cluster_calc_mode = False
        else:
            c.cluster_calc_mode = c.well_metric.cnv_calc_mode == QLWellChannelStatistics.CONC_CALC_MODE_CLUSTER
开发者ID:v-makarenko,项目名称:vtoolsmq,代码行数:46,代码来源:well.py


注:本文中的qtools.model.Session.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。