Someone
public text v1 · immutable# A Product can belong to a ProductGroup but each ProductGroup can
# have a representative main reference product along with the list of
# product group members.
class Product(DeclarativeBase):
...
productgroup_id = Column(Integer, ForeignKey('productgroup.id'))
productgroup = relation('ProductGroup', backref='products')
...
class ProductGroup(DeclarativeBase):
...
reference_product_id = Column(Integer, ForeignKey('product.id'))
reference_product = relation('Product')
...