Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sqlalchemy import ForeignKey
- from sqlalchemy.orm import Mapped, mapped_column
- from database import Base
- from datetime import datetime
- class Head(Base):
- head_name: Mapped[str]
- class Currency(Base):
- currency: Mapped[str]
- class Object(Base):
- object_name: Mapped[str]
- subobject: Mapped[str]
- ip_number: Mapped[str]
- object_cost: Mapped[int]
- head: Mapped[int] = mapped_column(ForeignKey('heads.id'))
- class Contractor(Base):
- name: Mapped[str]
- inn: Mapped[int]
- kpp: Mapped[int]
- ogrn: Mapped[int]
- description: Mapped[str]
- contacts: Mapped[str]
- class Contract(Base):
- contractor: Mapped[int] = mapped_column(ForeignKey('contractors.id'))
- customer: Mapped[int] = mapped_column(ForeignKey('contractors.id'))
- subobject: Mapped[int] = mapped_column(ForeignKey('objects.id'))
- number: Mapped[str]
- number_aa: Mapped[str]
- unmber_spec: Mapped[str]
- date: Mapped[datetime]
- cost_roubles: Mapped[float]
- currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
- cost_currency: Mapped[float]
- description: Mapped[str]
- date_start: Mapped[datetime]
- date_opentext: Mapped[datetime]
- date_approve: Mapped[datetime]
- date_sign: Mapped[datetime]
- comments: Mapped[str]
- class Payment(Base):
- contract: Mapped[int] = mapped_column(ForeignKey('contracts.id'))
- cost_payment_roubles: Mapped[float]
- currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
- cost_payment_curency: Mapped[float]
- date_payment: Mapped[datetime]
- description: Mapped[str]
- class Execution(Base):
- contract: Mapped[int] = mapped_column(ForeignKey('contracts.id'))
- cost_execution_roubles: Mapped[float]
- currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
- cost_execution_curency: Mapped[float]
- number_document: Mapped[str]
- date_document: Mapped[datetime]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement