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

Popular posts from this blog

php - Autoloader issue not returning Class -

javascript - How can I reference jquery library using cgi methods in ruby? -

ruby on rails - Scope conditionals for count? -