

@declared_attr
def addresses(cls):
    address_association = Table(('%s_addresses' % cls.__tablename__), cls.metadata, Column('address_id', ForeignKey('address.id'), primary_key=True), Column(('%s_id' % cls.__tablename__), ForeignKey(('%s.id' % cls.__tablename__)), primary_key=True))
    return relationship(Address, secondary=address_association)

dataset/ETHPy150Open zzzeek/sqlalchemy/examples/generic_associations/table_per_association.py HasAddresses.addresses/original