- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 18 for Items (0.12 sec)
-
docs_src/dependency_testing/tutorial001_py310.py
app.dependency_overrides[common_parameters] = override_dependency def test_override_in_items(): response = client.get("/items/") assert response.status_code == 200 assert response.json() == { "message": "Hello Items!", "params": {"q": None, "skip": 5, "limit": 10}, } def test_override_in_items_with_q(): response = client.get("/items/?q=foo") assert response.status_code == 200
Python - Registered: Sun May 05 07:19:11 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 May 05 07:19:11 GMT 2024 - Last Modified: Fri Aug 25 19:10:22 GMT 2023 - 451 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 item["size"] = size
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 646 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 May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 430 bytes - Viewed (0) -
docs_src/header_params/tutorial001_py310.py
Python - Registered: Sun May 05 07:19:11 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 May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 332 bytes - Viewed (0) -
docs_src/body_fields/tutorial001_py310.py
default=None, title="The description of the item", max_length=300 ) price: float = Field(gt=0, description="The price must be greater than zero") tax: float | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item}
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 523 bytes - Viewed (0) -
docs_src/cookie_params/tutorial001_py310.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 170 bytes - Viewed (0) -
docs_src/extra_data_types/tutorial001_py310.py
from datetime import datetime, time, timedelta from uuid import UUID from fastapi import Body, FastAPI app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, start_datetime: datetime = Body(), end_datetime: datetime = Body(), process_after: timedelta = Body(), repeat_at: time | None = Body(default=None), ): start_process = start_datetime + process_after
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Apr 19 00:11:40 GMT 2024 - 724 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial001_py310.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 363 bytes - Viewed (0)