Many to Many Relationships Many to Many relationship between two tables is achieved by adding an association table such that it has two foreign keys – one from each table’s primary key. Moreover, classes mapping to the two tables have an attribute with a collection of objects of other association tables assigned as secondary attribute […]
Category Archives: sqlalchemy
SQLAlchemy – Quick Guide SQLAlchemy – Introduction SQLAlchemy is a popular SQL toolkit and Object Relational Mapper. It is written in Python and gives full power and flexibility of SQL to an application developer. It is an open source and cross-platform software released under MIT license. SQLAlchemy is famous for its object-relational mapper (ORM), using […]
SQLAlchemy ORM – Deleting Related Objects It is easy to perform delete operation on a single table. All you have to do is to delete an object of the mapped class from a session and commit the action. However, delete operation on multiple related tables is little tricky. In our sales.db database, Customer and Invoice […]