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 - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -