mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Проверка
This commit is contained in:
23
backend/models.py
Normal file
23
backend/models.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from .database import Base
|
||||
|
||||
|
||||
class Employee(Base):
|
||||
__tablename__ = "employees"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
last_name = Column(String, index=True)
|
||||
# другие поля...
|
||||
|
||||
requests = relationship("Request", back_populates="employee")
|
||||
|
||||
|
||||
class Request(Base):
|
||||
__tablename__ = "requests"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
employee_id = Column(Integer, ForeignKey("employees.id"))
|
||||
# другие поля...
|
||||
|
||||
employee = relationship("Employee", back_populates="requests")
|
||||
Reference in New Issue
Block a user