How do I query the association table in SQLAlchemy?

I would like to retrieve only key pairs stored in the association table in SQLAlchemy. One way is to create an association class and do something like session.query(Assoc).all()


Can you query the mapping table in a similar way?


source to share

1 answer

Tables can be queried in the same way as declarative models. The request returns a list of keys, not instances of the class.





All Articles