feat: cascade deleting price rangecs

This commit is contained in:
2024-05-21 06:01:23 +03:00
parent ca6425021e
commit f874b41a07

View File

@@ -19,8 +19,11 @@ class Service(BaseModel):
nullable=False, nullable=False,
comment='Тип услуги') comment='Тип услуги')
price_ranges = relationship('ServicePriceRange', back_populates='service', lazy='selectin', price_ranges = relationship('ServicePriceRange',
order_by="asc(ServicePriceRange.from_quantity)") back_populates='service',
lazy='selectin',
order_by="asc(ServicePriceRange.from_quantity)",
cascade="all, delete-orphan")
class ServicePriceRange(BaseModel): class ServicePriceRange(BaseModel):