- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for resync (0.46 sec)
-
docs_src/response_model/tutorial002_py310.py
app = FastAPI() class UserIn(BaseModel): username: str password: str email: EmailStr full_name: str | None = None # Don't do this in production! @app.post("/user/") async def create_user(user: UserIn) -> UserIn:
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 318 bytes - Viewed (0) -
docs_src/body_updates/tutorial002_py310.py
"baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []}, } @app.get("/items/{item_id}", response_model=Item) async def read_item(item_id: str): return items[item_id] @app.patch("/items/{item_id}", response_model=Item) async def update_item(item_id: str, item: Item): stored_item_data = items[item_id] stored_item_model = Item(**stored_item_data)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 1010 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial002_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 446 bytes - Viewed (0) -
docs_src/query_params/tutorial002_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 219 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial002_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 276 bytes - Viewed (0) -
docs_src/security/tutorial002_py310.py
def fake_decode_token(token): return User( username=token + "fakedecoded", email="******@****.***", full_name="John Doe" ) async def get_current_user(token: str = Depends(oauth2_scheme)): user = fake_decode_token(token) return user @app.get("/users/me") async def read_users_me(current_user: User = Depends(get_current_user)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 711 bytes - Viewed (0) -
docs_src/body/tutorial002_py310.py
from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None app = FastAPI() @app.post("/items/") async def create_item(item: Item): item_dict = item.dict() if item.tax: price_with_tax = item.price + item.tax item_dict.update({"price_with_tax": price_with_tax})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 429 bytes - Viewed (0) -
docs_src/extra_models/tutorial002_py310.py
user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password) print("User saved! ..not really") return user_in_db @app.post("/user/", response_model=UserOut) async def create_user(user_in: UserIn): user_saved = fake_save_user(user_in)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 792 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial002_py310.py
tags: set[str] = set() @app.post("/items/", response_model=Item, tags=["items"]) async def create_item(item: Item): return item @app.get("/items/", tags=["items"]) async def read_items(): return [{"name": "Foo", "price": 42}] @app.get("/users/", tags=["users"]) async def read_users():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 537 bytes - Viewed (0) -
docs_src/header_params/tutorial002_py310.py
from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items( strange_header: str | None = Header(default=None, convert_underscores=False), ):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 228 bytes - Viewed (0)