mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
20 lines
697 B
Python
20 lines
697 B
Python
"""User model."""
|
|
from sqlalchemy import Boolean, Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
from app.database import Base
|
|
|
|
class User(Base):
|
|
"""User model."""
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True)
|
|
full_name = Column(String)
|
|
hashed_password = Column(String)
|
|
is_active = Column(Boolean, default=True)
|
|
is_admin = Column(Boolean, default=False)
|
|
|
|
# Отношения
|
|
requests = relationship("Request", back_populates="employee")
|
|
chats = relationship("Chat", back_populates="employee")
|
|
messages = relationship("Message", back_populates="sender") |