blob: c2e9003ebe45b9924f6a429ccefe0a74382cd245 (
plain)
1
2
3
|
Adjacency list is a self-referential relationship. In SQLAlchemy we can achieve this by creating a ForeignKey on the table to itself. In the mapper we can add a relationship property and specify remote_side=[table.c.id].
This is what I used to give backups a "base" reference.
|