SQLAlchemy如何篩選值爲None的列?

示例

from sqlalchemy import create_engine, MetaData, and_, or_, TIMESTAMP
Plugin.query.filter(and_(Plugin.job_name == job_name, or_(Plugin.group_id.is_(None), Plugin.group_id == delete_list[0]),
                        Plugin.plugin_name == delete_list[1], Plugin.plugin_version == delete_list[2],
                        Plugin.plugin_state == delete_list[3])).delete()

更多操做符

見/Users/xxx/.virtualenvs/erebus_app/lib/python3.6/site-packages/sqlalchemy/sql/operators.py
好比:startwith/endwith/contains/asc/desc/is_/isnotpython

相關文章
相關標籤/搜索