Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 128 for Tax (0.01 seconds)

  1. docs_src/schema_extra_example/tutorial003_py310.py

        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,
                    "tax": 3.2,
                }
            ],
        ),
    ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 574 bytes
    - Click Count (0)
  2. docs_src/schema_extra_example/tutorial003_an_py310.py

        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",
                        "price": 35.4,
                        "tax": 3.2,
                    }
                ],
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 673 bytes
    - Click Count (0)
  3. docs_src/schema_extra_example/tutorial004_py310.py

        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,
                    "tax": 3.2,
                },
                {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 786 bytes
    - Click Count (0)
  4. docs/zh-hant/docs/tutorial/body-updates.md

    這表示,如果你想用 `PUT` 並在 body 中包含以下內容來更新項目 `bar`:
    
    ```Python
    {
        "name": "Barz",
        "price": 3,
        "description": None,
    }
    ```
    
    由於這裡沒有包含已儲存的屬性 `"tax": 20.2`,輸入的模型會採用預設值 `"tax": 10.5`。
    
    最終資料會以這個「新的」 `tax` 值 `10.5` 被儲存。
    
    ## 使用 `PATCH` 進行部分更新 { #partial-updates-with-patch }
    
    你也可以使用 [HTTP `PATCH`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) 操作來進行*部分*更新。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  5. docs_src/schema_extra_example/tutorial004_an_py310.py

    from typing import Annotated
    
    from fastapi import Body, FastAPI
    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=[
                    {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 917 bytes
    - Click Count (0)
  6. docs_src/body_nested_models/tutorial001_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: list = []
    
    
    @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
    - 364 bytes
    - Click Count (0)
  7. docs_src/schema_extra_example/tutorial005_py310.py

    from fastapi import Body, FastAPI
    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(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 1.3K bytes
    - Click Count (0)
  8. tests/test_pydanticv2_dataclasses_uuid_stringified_annotations.py

    from inline_snapshot import snapshot
    
    
    @dataclass
    class Item:
        id: uuid.UUID
        name: str
        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",
    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)
  9. docs_src/body_multiple_params/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        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):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 446 bytes
    - Click Count (0)
  10. docs_src/body/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 330 bytes
    - Click Count (0)
Back to Top