Chrome Extension

Replace NULL with false while Selecting in SQLAlchemy

Here we are replacing active column value of user table with false if it is null
from sqlalchemy import func

# SYNTAX - func.coalesce(model.prop, default_value)
    func.coalesce(, false).label('is_active'),
    UserModel.status == 'active'
Code faster with devsheet chrome extension and increase productivity as a programmer
search code from your favorite search engine instantly.
Install Now
Was this helpful?
Open Code Manager We are hiring