Add Subdepartment.products
relationship.
For the sake of clearing FK's when deleting a subdepartment.
This commit is contained in:
parent
4d7f7adae4
commit
e46803dfbc
|
@ -174,7 +174,11 @@ UTC timestamp of the product's last sale event.
|
|||
""")
|
||||
|
||||
department = orm.relationship(Department, order_by=Department.name)
|
||||
subdepartment = orm.relationship(Subdepartment, order_by=Subdepartment.name)
|
||||
|
||||
subdepartment = orm.relationship(
|
||||
Subdepartment,
|
||||
order_by=Subdepartment.name,
|
||||
backref=orm.backref('products', cascade='all'))
|
||||
|
||||
category = orm.relationship(
|
||||
Category, back_populates='products')
|
||||
|
|
Loading…
Reference in a new issue