Coverage for docs_src/sql_databases/sql_app_py39/schemas.py: 100%
22 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from typing import Union 1abcd
3from pydantic import BaseModel 1abcd
6class ItemBase(BaseModel): 1abcd
7 title: str 1abcd
8 description: Union[str, None] = None 1abcd
11class ItemCreate(ItemBase): 1abcd
12 pass 1abcd
15class Item(ItemBase): 1abcd
16 id: int 1abcd
17 owner_id: int 1abcd
19 class Config: 1abcd
20 orm_mode = True 1abcd
23class UserBase(BaseModel): 1abcd
24 email: str 1abcd
27class UserCreate(UserBase): 1abcd
28 password: str 1abcd
31class User(UserBase): 1abcd
32 id: int 1abcd
33 is_active: bool 1abcd
34 items: list[Item] = [] 1abcd
36 class Config: 1abcd
37 orm_mode = True 1abcd