back_populate solves this.
Full Example:
from sqlalchemy import create_engine, Column, ForeignKey, Integerfrom
sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy.orm import
relationship, sessionmaker
Base = declarative_base()
## Modelclass Parent(Base):
__tablename__ =
Immediately I notice that the attributes `father`/`mother` have no
relationship to the `Parent` object. I think specifying
backref/back_populates should solve your issue:
http://docs.sqlalchemy.org/en/rel_1_0/orm/backref.html
Also, FYI
You can use `expire` on just the relationships