当前位置:天才代写 > tutorial > Python教程 > python flask-sqlalchemy

python flask-sqlalchemy

2018-05-17 08:00 星期四 所属: Python教程 浏览:285

python">    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

 

    关键字:

天才代写-代写联系方式