flask-sqlalchemy同字段多条件过滤

 

举例

from sqlalchemy import or_,and_
#
from operator import or_, and_


allapp = AppServer.query.filter(and_(
    AppServer.software!='zookeeper',
    AppServer.software!='keepalived',
    AppServer.software!='openresty',
)).with_entities(AppServer.software).distinct().all()

 

posted @ 2020-08-06 17:45  醒日是归时  阅读(1342)  评论(0编辑  收藏  举报