Add Subdepartment.products relationship.
				
					
				
			For the sake of clearing FK's when deleting a subdepartment.
This commit is contained in:
		
							parent
							
								
									4d7f7adae4
								
							
						
					
					
						commit
						e46803dfbc
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -174,7 +174,11 @@ UTC timestamp of the product's last sale event.
 | 
				
			||||||
""")
 | 
					""")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    department = orm.relationship(Department, order_by=Department.name)
 | 
					    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 = orm.relationship(
 | 
				
			||||||
        Category, back_populates='products')
 | 
					        Category, back_populates='products')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue