feat: client endpoints for clients page
This commit is contained in:
@ -5,6 +5,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from models.base import BaseModel
|
||||
from models.mixins import IdMixin, SoftDeleteMixin
|
||||
from modules.clients.models import Client
|
||||
from modules.fulfillment_base.models import (
|
||||
ProductBarcode,
|
||||
BarcodeTemplate,
|
||||
@ -28,6 +29,9 @@ class Product(BaseModel, IdMixin, SoftDeleteMixin):
|
||||
default="", comment="Дополнительная информация"
|
||||
)
|
||||
|
||||
client_id: Mapped[int] = mapped_column(ForeignKey("clients.id"))
|
||||
client: Mapped["Client"] = relationship(back_populates="products")
|
||||
|
||||
images: Mapped[list["ProductImage"]] = relationship(
|
||||
"ProductImage",
|
||||
back_populates="product",
|
||||
|
||||
Reference in New Issue
Block a user