I realize this is actually an SQL question but I haven't been able to
figure out the answer.
In a simple self-referential table, the following produces all the
Nodes that are parents to some child node(s):
node_table_alias = node_table.alias()
parents = session.query(Node).filter(Node.id == node
The table is the following:
item_table = Table('item', metadata,
Column('id', Integer, primary_key=True),
Column('uuid', String(32), unique=True, nullable=False),
Column('parent_uuid', String(32), ForeignKey('item.uuid'), nullable=True),
...
With mapper:
mapper(Item, item_table,
pro