Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 220 for head_item (0.64 seconds)

  1. 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)
  2. docs/pt/docs/advanced/templates.md

    Logo, a seção com:
    
    {% raw %}
    
    ```jinja
    <a href="{{ url_for('read_item', id=id) }}">
    ```
    
    {% endraw %}
    
    ...irá gerar um link para a mesma URL que será tratada pela *path operation function* `read_item(id=id)`.
    
    Por exemplo, com um ID de `42`, isso renderizará:
    
    ```html
    <a href="/items/42">
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 3.6K bytes
    - Click Count (0)
  3. docs_src/response_model/tutorial004_py310.py

        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    @app.get("/items/{item_id}", response_model=Item, response_model_exclude_unset=True)
    async def read_item(item_id: str):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 595 bytes
    - Click Count (0)
  4. docs/de/docs/advanced/templates.md

    Der Abschnitt mit:
    
    {% raw %}
    
    ```jinja
    <a href="{{ url_for('read_item', id=id) }}">
    ```
    
    {% endraw %}
    
    ... generiert also einen Link zu derselben URL, welche von der *Pfadoperation-Funktion* `read_item(id=id)` gehandhabt werden würde.
    
    Mit beispielsweise der ID `42` würde dies Folgendes ergeben:
    
    ```html
    <a href="/items/42">
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 4.2K bytes
    - Click Count (0)
  5. fastapi/.agents/skills/fastapi/references/other-tools.md

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    def do_blocking_work(name: str) -> str:
        # Some blocking I/O operation
        return f"Hello {name}"
    
    
    @app.get("/items/")
    async def read_items():
        result = await asyncify(do_blocking_work)(name="World")
        return {"message": result}
    ```
    
    And run async code inside of blocking sync code with `syncify()`:
    
    ```python
    from asyncer import syncify
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  6. docs_src/additional_responses/tutorial003_py310.py

                "content": {
                    "application/json": {
                        "example": {"id": "bar", "value": "The bar tenders"}
                    }
                },
            },
        },
    )
    async def read_item(item_id: str):
        if item_id == "foo":
            return {"id": "foo", "value": "there goes my hero"}
        else:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 837 bytes
    - Click Count (0)
  7. docs/zh-hant/docs/advanced/templates.md

    你也可以在模板中使用 `url_for()`,它所接受的參數與你的「*路徑操作函式(path operation function)*」所使用的參數相同。
    
    因此,包含以下內容的區塊:
    
    {% raw %}
    
    ```jinja
    <a href="{{ url_for('read_item', id=id) }}">
    ```
    
    {% endraw %}
    
    ...會產生指向與「*路徑操作函式*」`read_item(id=id)` 相同 URL 的連結。
    
    例如,若 ID 為 `42`,會渲染為:
    
    ```html
    <a href="/items/42">
    ```
    
    ## 模板與靜態檔案 { #templates-and-static-files }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 3.3K bytes
    - Click Count (0)
  8. docs_src/body_updates/tutorial001_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.put("/items/{item_id}", response_model=Item)
    async def update_item(item_id: str, item: Item):
        update_item_encoded = jsonable_encoder(item)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 856 bytes
    - Click Count (0)
  9. docs/ja/docs/advanced/templates.md

    テンプレート内でも `url_for()` を使用できます。引数には、対応する path operation 関数で使われるのと同じ引数を取ります。
    
    したがって、次の部分は:
    
    {% raw %}
    
    ```jinja
    <a href="{{ url_for('read_item', id=id) }}">
    ```
    
    {% endraw %}
    
    ...path operation 関数 `read_item(id=id)` が処理するのと同じ URL へのリンクを生成します。
    
    例えば、ID が `42` の場合は次のようにレンダリングされます:
    
    ```html
    <a href="/items/42">
    ```
    
    ## テンプレートと静的ファイル { #templates-and-static-files }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  10. tests/test_pydanticv2_dataclasses_uuid_stringified_annotations.py

        price: float
        tags: list[str] = field(default_factory=list)
        description: str | None = None
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.get("/item", response_model=Item)
    async def read_item():
        return {
            "id": uuid.uuid4(),
            "name": "Island In The Moon",
            "price": 12.99,
            "description": "A place to be playin' and havin' fun",
            "tags": ["breater"],
        }
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 16 10:16:48 GMT 2026
    - 1.1K bytes
    - Click Count (0)
Back to Top