From 683586d6f0c09ae963c699fd3cd8778a48d22a59 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 7 Aug 2020 01:54:22 +0200 Subject: [PATCH] refactor: updated schema to better reflect the models --- app/schemas.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index f9dbcff..a4deb1b 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -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