Chrome Extension

Join models or tables query Sqlalchemy

Joining tables query in Sqlalchemy can be written as below
#JOINING TABLE (User and Address)
self.session.query(
    User.id,
    User.first_name,
    User.last_name,
    Address.city,
    Address.State
).join(
    Address, User.id == Address.user_id
).filter(
    Address.city.like('new%'))
).all()
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?
0 Comments
Open Code Manager We are hiring