temp images on products
This commit is contained in:
@@ -24,6 +24,19 @@ class Product(BaseModel):
|
||||
composition = Column(String, nullable=True, comment='Состав')
|
||||
size = Column(String, nullable=True, comment='Размер')
|
||||
additional_info = Column(String, nullable=True, comment='Дополнительное поле')
|
||||
images = relationship('ProductImage',
|
||||
back_populates='product',
|
||||
|
||||
cascade="all, delete-orphan")
|
||||
|
||||
|
||||
class ProductImage(BaseModel):
|
||||
__tablename__ = 'product_images'
|
||||
id = Column(Integer, autoincrement=True, primary_key=True, index=True)
|
||||
product_id = Column(Integer, ForeignKey('products.id'), nullable=False)
|
||||
product = relationship('Product', back_populates='images')
|
||||
|
||||
image_url = Column(String, nullable=False)
|
||||
|
||||
|
||||
class ProductBarcode(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user