mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
19 lines
672 B
Python
19 lines
672 B
Python
"""Employee models"""
|
|
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
from ..db.base_class import Base
|
|
|
|
|
|
class Employee(Base):
|
|
"""Employee model"""
|
|
__tablename__ = "employees"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
first_name = Column(String, nullable=False)
|
|
last_name = Column(String, nullable=False)
|
|
department = Column(String, nullable=False)
|
|
office = Column(String, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
|
|
# Определяем отношение к Request
|
|
requests = relationship("Request", back_populates="employee", cascade="all, delete-orphan") |