refactor: updated schema to better reflect the models

This commit is contained in:
surtur 2020-08-07 01:54:22 +02:00
parent 35dbbffd49
commit 683586d6f0
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -5,41 +5,37 @@ from pydantic import BaseModel
class ServiceBase(BaseModel):
name: str
owner_id: int
is_private: bool = True
description: Optional[str] = None
service_type: int
url: str
owner_id: Optional[int] = None
is_active: bool = True
updated_unix: float
class Service(BaseModel):
name: str
owner_id: int
is_active: bool = True
created_unix: float
updated_unix: float = None
class ServiceCreate(ServiceBase):
pass
class Service(ServiceBase):
owner_id: int
pass
class Config:
orm_mode = True
class UserBase(BaseModel):
name: str
full_name: Optional[str] = None
is_active: bool = True
class User(BaseModel):
name: str
full_name: Optional[str] = None
is_active: bool = True
last_login_unix: float
created_unix: float
updated_unix: float = None
last_login_unix: float = None
class UserCreate(UserBase):
password: str