flask-sqlalchemy

2015-02-04 0 290
flask-sqlalchemy
    def get_appsys_by_no(self, no):
        o_type = self.order_type(no)
        table_name = "t_order_" + o_type.lower()
        #: result = db.session.execute("SELECT * FROM %s where no = '%s'" %(table_name, no))
        result = db.session.execute("SELECT * FROM %s where no = :no" % table_name, {'no': no})
        Record = namedtuple('Record', result.keys())
        records = [Record(*r) for r in result.fetchall()]
        return records[0] if records else None

遇见资源网 python flask-sqlalchemy http://www.ox520.com/15118.html

爬虫 邻居的耳朵
上一篇: 爬虫 邻居的耳朵
模拟时钟
下一篇: 模拟时钟
常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务