feat: a lot of a lot
This commit is contained in:
39
models/marketplace_products.py
Normal file
39
models/marketplace_products.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import Mapped, relationship, mapped_column
|
||||
|
||||
from models import BaseModel
|
||||
from models import Marketplace
|
||||
from models import Product
|
||||
|
||||
|
||||
class WildberriesProduct(BaseModel):
|
||||
__tablename__ = 'wildberries_products'
|
||||
|
||||
marketplace_id: Mapped[int] = mapped_column(ForeignKey('marketplaces.id'), primary_key=True)
|
||||
marketplace: Mapped["Marketplace"] = relationship()
|
||||
|
||||
product_id: Mapped[int] = mapped_column(ForeignKey('products.id'), primary_key=True)
|
||||
product: Mapped["Product"] = relationship()
|
||||
|
||||
nm_uuid: Mapped[str] = mapped_column(nullable=False)
|
||||
|
||||
|
||||
class OzonProduct(BaseModel):
|
||||
__tablename__ = 'ozon_products'
|
||||
|
||||
marketplace_id: Mapped[int] = mapped_column(ForeignKey('marketplaces.id'), primary_key=True)
|
||||
marketplace: Mapped["Marketplace"] = relationship()
|
||||
|
||||
product_id: Mapped[int] = mapped_column(ForeignKey('products.id'), primary_key=True)
|
||||
product: Mapped["Product"] = relationship()
|
||||
|
||||
|
||||
|
||||
class YandexProduct(BaseModel):
|
||||
__tablename__ = 'yandex_products'
|
||||
|
||||
marketplace_id: Mapped[int] = mapped_column(ForeignKey('marketplaces.id'), primary_key=True)
|
||||
marketplace: Mapped["Marketplace"] = relationship()
|
||||
|
||||
product_id: Mapped[int] = mapped_column(ForeignKey('products.id'), primary_key=True)
|
||||
product: Mapped["Product"] = relationship()
|
||||
Reference in New Issue
Block a user