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 flask-sqlalchemy
最后更新 2018-05-17 08:00 星期四 所属:
Python教程 浏览:318