mirror of
https://github.com/flibusta-apps/users_settings_server.git
synced 2025-12-06 14:45:38 +01:00
Init
This commit is contained in:
22
src/app/serializers.py
Normal file
22
src/app/serializers.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from pydantic import BaseModel, constr
|
||||
|
||||
|
||||
class LanguageDetail(BaseModel):
|
||||
id: int
|
||||
label: constr(max_length=16) # type: ignore
|
||||
code: constr(max_length=4) # type: ignore
|
||||
|
||||
|
||||
class UserBase(BaseModel):
|
||||
user_id: int
|
||||
last_name: constr(max_length=64) # type: ignore
|
||||
first_name: constr(max_length=64) # type: ignore
|
||||
username: constr(max_length=32) # type: ignore
|
||||
|
||||
|
||||
class UserCreateOrUpdate(BaseModel):
|
||||
allowed_langs: list[str]
|
||||
|
||||
|
||||
class UserDetail(UserCreateOrUpdate):
|
||||
allowed_langs: list[LanguageDetail]
|
||||
Reference in New Issue
Block a user