Advertisement
kompilainenn

Untitled

Dec 17th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.91 KB | None | 0 0
  1. from sqlalchemy import ForeignKey
  2. from sqlalchemy.orm import Mapped, mapped_column
  3. from database import Base
  4. from datetime import datetime
  5.  
  6. class Head(Base):
  7.     head_name: Mapped[str]
  8.    
  9. class Currency(Base):
  10.     currency: Mapped[str]
  11.  
  12. class Object(Base):
  13.     object_name: Mapped[str]
  14.     subobject: Mapped[str]
  15.     ip_number: Mapped[str]
  16.     object_cost: Mapped[int]
  17.     head: Mapped[int] = mapped_column(ForeignKey('heads.id'))
  18.  
  19. class Contractor(Base):
  20.     name: Mapped[str]
  21.     inn: Mapped[int]
  22.     kpp: Mapped[int]
  23.     ogrn: Mapped[int]
  24.     description: Mapped[str]
  25.     contacts: Mapped[str]
  26.  
  27. class Contract(Base):
  28.     contractor: Mapped[int] = mapped_column(ForeignKey('contractors.id'))
  29.     customer: Mapped[int] = mapped_column(ForeignKey('contractors.id'))
  30.     subobject: Mapped[int] = mapped_column(ForeignKey('objects.id'))
  31.     number: Mapped[str]
  32.     number_aa: Mapped[str]
  33.     unmber_spec: Mapped[str]
  34.     date: Mapped[datetime]
  35.     cost_roubles: Mapped[float]
  36.     currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
  37.     cost_currency: Mapped[float]
  38.     description: Mapped[str]
  39.     date_start: Mapped[datetime]
  40.     date_opentext: Mapped[datetime]
  41.     date_approve: Mapped[datetime]
  42.     date_sign: Mapped[datetime]
  43.     comments: Mapped[str]
  44.  
  45. class Payment(Base):
  46.     contract: Mapped[int] = mapped_column(ForeignKey('contracts.id'))
  47.     cost_payment_roubles: Mapped[float]
  48.     currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
  49.     cost_payment_curency: Mapped[float]
  50.     date_payment: Mapped[datetime]
  51.     description: Mapped[str]
  52.  
  53. class Execution(Base):
  54.     contract: Mapped[int] = mapped_column(ForeignKey('contracts.id'))
  55.     cost_execution_roubles: Mapped[float]
  56.     currency: Mapped[int] = mapped_column(ForeignKey('currencys.id'))
  57.     cost_execution_curency: Mapped[float]
  58.     number_document: Mapped[str]
  59.     date_document: Mapped[datetime]
  60.  
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement