Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 441 - 450 of 795 for asyncId (0.05 seconds)

  1. tests/test_filter_pydantic_sub_model_pv2.py

                if not name.endswith("A"):
                    raise ValueError("name must end in A")
                return name
    
        async def get_model_c() -> ModelC:
            return ModelC(username="test-user", password="test-password")
    
        @app.get("/model/{name}", response_model=ModelA)
        async def get_model_a(name: str, model_c=Depends(get_model_c)):
            return {
                "name": name,
                "description": "model-a-desc",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 6.7K bytes
    - Click Count (0)
  2. docs_src/path_params_numeric_validations/tutorial005_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get", gt=0, le=1000)],
        q: str,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 331 bytes
    - Click Count (0)
  3. docs_src/additional_responses/tutorial004_py310.py

    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={**responses, 200: {"content": {"image/png": {}}}},
    )
    async def read_item(item_id: str, img: bool | None = None):
        if img:
            return FileResponse("image.png", media_type="image/png")
        else:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 669 bytes
    - Click Count (0)
  4. docs_src/body_multiple_params/tutorial001_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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: str | None = None,
        item: Item | None = None,
    ):
        results = {"item_id": item_id}
        if q:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 579 bytes
    - Click Count (0)
  5. docs_src/dependencies/tutorial002_an_py310.py

    
    class CommonQueryParams:
        def __init__(self, q: str | None = None, skip: int = 0, limit: int = 100):
            self.q = q
            self.skip = skip
            self.limit = limit
    
    
    @app.get("/items/")
    async def read_items(commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]):
        response = {}
        if commons.q:
            response.update({"q": commons.q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 664 bytes
    - Click Count (0)
  6. docs/zh/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
    
    /// tip | 提示
    
    尽可能优先使用 `Annotated` 版本。
    
    ///
    
    ```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 13:37:57 GMT 2026
    - 3.8K bytes
    - Click Count (0)
  7. docs_src/body/tutorial001_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):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 271 bytes
    - Click Count (0)
  8. docs_src/dataclasses_/tutorial001_py310.py

    from fastapi import FastAPI
    
    
    @dataclass
    class Item:
        name: str
        price: float
        description: str | None = None
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 275 bytes
    - Click Count (0)
  9. docs_src/query_params_str_validations/tutorial014_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None,
    ):
        if hidden_query:
            return {"hidden_query": hidden_query}
        else:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 331 bytes
    - Click Count (0)
  10. docs/tr/docs/alternatives.md

    ///
    
    ### [Sanic](https://sanic.readthedocs.io/en/latest/) { #sanic }
    
    `asyncio` tabanlı, son derece hızlı ilk Python framework’lerinden biriydi. Flask’a oldukça benzer olacak şekilde geliştirilmişti.
    
    /// note | Teknik Detaylar
    
    Varsayılan Python `asyncio` döngüsü yerine [`uvloop`](https://github.com/MagicStack/uvloop) kullanır; hızını esasen bu sağlar.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 24K bytes
    - Click Count (0)
Back to Top