Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 481 - 490 of 795 for asyncId (0.47 seconds)

  1. docs_src/query_param_models/tutorial002_py310.py

        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: FilterParams = Query()):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Sep 17 18:54:10 GMT 2024
    - 462 bytes
    - Click Count (0)
  2. docs_src/body_nested_models/tutorial005_py310.py

    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
        image: Image | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 468 bytes
    - Click Count (0)
  3. docs_src/templates/tutorial001_py310.py

    app = FastAPI()
    
    app.mount("/static", StaticFiles(directory="static"), name="static")
    
    
    templates = Jinja2Templates(directory="templates")
    
    
    @app.get("/items/{id}", response_class=HTMLResponse)
    async def read_item(request: Request, id: str):
        return templates.TemplateResponse(
            request=request, name="item.html", context={"id": id}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 521 bytes
    - Click Count (0)
  4. docs_src/query_params_str_validations/tutorial008_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            str | None,
            Query(
                title="Query string",
                description="Query string for the items to search in the database that have a good match",
                min_length=3,
            ),
        ] = None,
    ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 498 bytes
    - Click Count (0)
  5. docs_src/schema_extra_example/tutorial003_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Item = Body(
            examples=[
                {
                    "name": "Foo",
                    "description": "A very nice Item",
                    "price": 35.4,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 574 bytes
    - Click Count (0)
  6. tests/test_stream_json_validation_error.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    app = FastAPI()
    
    
    @app.get("/items/stream-invalid")
    async def stream_items_invalid() -> AsyncIterable[Item]:
        yield {"name": "valid", "price": 1.0}
        yield {"name": "invalid", "price": "not-a-number"}
    
    
    @app.get("/items/stream-invalid-sync")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 27 18:56:47 GMT 2026
    - 991 bytes
    - Click Count (0)
  7. docs_src/body_multiple_params/tutorial003_py310.py

        description: str | None = None
        price: float
        tax: float | None = None
    
    
    class User(BaseModel):
        username: str
        full_name: str | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item, user: User, importance: int = Body()):
        results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 504 bytes
    - Click Count (0)
  8. docs_src/schema_extra_example/tutorial003_an_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Annotated[
            Item,
            Body(
                examples=[
                    {
                        "name": "Foo",
                        "description": "A very nice Item",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 673 bytes
    - Click Count (0)
  9. tests/test_schema_ref_pydantic_v2.py

            ref: str = Field(validation_alias="$ref", serialization_alias="$ref")
            model_config = ConfigDict(validate_by_alias=True, serialize_by_alias=True)
    
        @app.get("/", response_model=ModelWithRef)
        async def read_root() -> Any:
            return {"$ref": "some-ref"}
    
        client = TestClient(app)
        return client
    
    
    def test_get(client: TestClient):
        response = client.get("/")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  10. docs/tr/docs/tutorial/dependencies/sub-dependencies.md

    //// tab | Python 3.10+
    
    ```Python hl_lines="1"
    async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
        return {"fresh_value": fresh_value}
    ```
    
    ////
    
    //// tab | Python 3.10+ Annotated olmayan
    
    /// tip | İpucu
    
    Mümkünse `Annotated` sürümünü tercih edin.
    
    ///
    
    ```Python hl_lines="1"
    async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 12:41:38 GMT 2026
    - 4.2K bytes
    - Click Count (0)
Back to Top