1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Все подряд

This commit is contained in:
MoonTestUse1
2024-12-31 02:37:57 +06:00
parent 8e53bb6cb2
commit d5780b2eab
3258 changed files with 1087440 additions and 268 deletions

View File

@@ -1,21 +1,20 @@
from pydantic import BaseModel
"""Employee models"""
from pydantic import BaseModel, Field
from datetime import datetime
from typing import Optional
class EmployeeBase(BaseModel):
last_name: str
first_name: str
department: str
office: str
first_name: str = Field(..., min_length=1)
last_name: str = Field(..., min_length=1)
department: str = Field(..., pattern="^(aho|gkh|general)$")
office: str = Field(..., min_length=1)
class EmployeeCreate(EmployeeBase):
password: str
password: str = Field(..., min_length=6)
class Employee(EmployeeBase):
id: int
created_at: datetime
class Config:
from_attributes = True
from_attributes = True