📜  flask sqlalchemy 过滤多个条件 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:28.739000             🧑  作者: Mango

代码示例1
#Using filter() (and operator)
query = meta.Session.query(User).filter(
    User.firstname.like(search_var1),
    User.lastname.like(search_var2)
    )
#Using filter_by() (and operator)
query = meta.Session.query(User).filter_by(
    firstname.like(search_var1),
    lastname.like(search_var2)
    )