reflex-examples
reflex-examples copied to clipboard
How should the table relationship be?
class ProductGroup(pc.Model, table=True):
code: str = None
name: str
class Product(pc.Model, table=True):
code: str = None
name: str
price = float
image: str = None
description: str = None
is_active: bool = True
productgroup: ProductGroup
The Product table is related to the ProductGroup table with a foreign key. The above definition doesn't work!