- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for fakeFs (0.17 sec)
-
docs_src/encoder/tutorial001_py310.py
from fastapi.encoders import jsonable_encoder from pydantic import BaseModel fake_db = {} class Item(BaseModel): title: str timestamp: datetime description: str | None = None app = FastAPI() @app.put("/items/{id}") def update_item(id: str, item: Item): json_compatible_item_data = jsonable_encoder(item)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 430 bytes - Viewed (0) -
docs_src/extra_models/tutorial001_py310.py
class UserInDB(BaseModel): username: str hashed_password: str email: EmailStr full_name: str | None = None def fake_password_hasher(raw_password: str): return "supersecret" + raw_password def fake_save_user(user_in: UserIn): hashed_password = fake_password_hasher(user_in.password) user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password) print("User saved! ..not really")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 899 bytes - Viewed (0)