SQLAlchemy

判断记录是否存在

from sqlalchemy.sql import exists

obj_exists =  session.query(exists().where(User.email == '...')).scalar()

正文完
 
评论(没有评论)