- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for cdef (0.14 sec)
-
docs_src/dependency_testing/tutorial001_py310.py
from fastapi.testclient import TestClient app = FastAPI() async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: dict = Depends(common_parameters)): return {"message": "Hello Items!", "params": commons} @app.get("/users/") async def read_users(commons: dict = Depends(common_parameters)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 1.4K bytes - Viewed (0) -
docs_src/separate_openapi_schemas/tutorial001_py310.py
from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() @app.post("/items/") def create_item(item: Item): return item @app.get("/items/") def read_items() -> list[Item]: return [ Item( name="Portal Gun", description="Device to travel through the multi-rick-verse", ),
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Aug 25 19:10:22 GMT 2023 - 451 bytes - Viewed (0) -
docs_src/encoder/tutorial001_py310.py
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 Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 430 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001_py310.py
from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: str | None = Body(default=None), size: int | None = Body(default=None), ): if item_id in items: item = items[item_id] item["name"] = name
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 646 bytes - Viewed (0) -
docs_src/header_params/tutorial001_py310.py
from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(user_agent: str | None = Header(default=None)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 182 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial001_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 332 bytes - Viewed (0) -
docs_src/body_fields/tutorial001_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 523 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)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 899 bytes - Viewed (0) -
docs_src/cookie_params/tutorial001_py310.py
from fastapi import Cookie, FastAPI app = FastAPI() @app.get("/items/") async def read_items(ads_id: str | None = Cookie(default=None)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 170 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial001_py310.py
name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() @app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED) async def create_item(item: Item):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 363 bytes - Viewed (0)