python - How can I check to see if some data exists and return a boolean value using SQLAlchemy -
i building flask web-app using sqlalchemy. how can check see if data exists , if exists return true , vice-versa?
you :
exists = db.session.query(your_id).filter_by(your_filter).scalar() not none
Comments
Post a Comment