Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 365 for items (0.14 sec)

  1. docs/zh/docs/advanced/dataclasses.md

    ```
    
    1. 本例依然要从标准的 `dataclasses` 中导入 `field`;
    
    2. 使用 `pydantic.dataclasses` 直接替换 `dataclasses`;
    
    3. `Author` 数据类包含 `Item` 数据类列表;
    
    4. `Author` 数据类用于 `response_model` 参数;
    
    5. 其它带有数据类的标准类型注解也可以作为请求体;
    
        本例使用的是 `Item` 数据类列表;
    
    6. 这行代码返回的是包含 `items` 的字典,`items` 是数据类列表;
    
        FastAPI 仍能把数据<abbr title="把数据转换为可以传输的格式">序列化</abbr>为 JSON;
    
    7. 这行代码中,`response_model` 的类型注解是 `Author` 数据类列表;
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:14 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. docs/fr/docs/external-links.md

    {% for section_name, section_content in external_links.items() %}
    
    ## {{ section_name }}
    
    {% for lang_name, lang_content in section_content.items() %}
    
    ### {{ lang_name }}
    
    {% for item in lang_content %}
    
    * <a href="{{ item.link }}" class="external-link" target="_blank">{{ item.title }}</a> by <a href="{{ item.author_link }}" class="external-link" target="_blank">{{ item.author }}</a>.
    
    {% endfor %}
    {% endfor %}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Oct 22 07:35:13 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  3. docs/ja/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: bool = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 21K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/dependencies/index.md

    admin_user(["admin_user"])
    paying_user(["paying_user"])
    
    public["/items/public/"]
    private["/items/private/"]
    activate_user["/users/{user_id}/activate"]
    pro_items["/items/pro/"]
    
    current_user --> active_user
    active_user --> admin_user
    active_user --> paying_user
    
    current_user --> public
    active_user --> private
    admin_user --> activate_user
    paying_user --> pro_items
    ```
    
    ## Интегрировано с **OpenAPI**
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.7K bytes
    - Viewed (0)
  5. docs/em/docs/external-links.md

    ## 📄
    
    {% for section_name, section_content in external_links.items() %}
    
    ## {{ section_name }}
    
    {% for lang_name, lang_content in section_content.items() %}
    
    ### {{ lang_name }}
    
    {% for item in lang_content %}
    
    * <a href="{{ item.link }}" class="external-link" target="_blank">{{ item.title }}</a> by <a href="{{ item.author_link }}" class="external-link" target="_blank">{{ item.author }}</a>.
    
    {% endfor %}
    {% endfor %}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Oct 22 07:35:13 GMT 2023
    - 929 bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial001.py!}
    ```
    
    The value of the path parameter `item_id` will be passed to your function as the argument `item_id`.
    
    So, if you run this example and go to <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, you will see a response of:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Path parameters with types
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial001.py!}
    ```
    
    Значение параметра пути `item_id` будет передано в функцию в качестве аргумента `item_id`.
    
    Если запустите этот пример и перейдёте по адресу: <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, то увидите ответ:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Параметры пути с типами
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/path-params.md

    ```
    
    这段代码把路径参数 `item_id` 的值传递给路径函数的参数 `item_id`。
    
    运行示例并访问 <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>,可获得如下响应:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## 声明路径参数的类型
    
    使用 Python 标准类型注解,声明路径操作函数中路径参数的类型。
    
    ```Python hl_lines="7"
    {!../../../docs_src/path_params/tutorial002.py!}
    ```
    
    本例把 `item_id` 的类型声明为 `int`。
    
    !!! check "检查"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 05:35:40 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/dependencies/index.md

    admin_user(["admin_user"])
    paying_user(["paying_user"])
    
    public["/items/public/"]
    private["/items/private/"]
    activate_user["/users/{user_id}/activate"]
    pro_items["/items/pro/"]
    
    current_user --> active_user
    active_user --> admin_user
    active_user --> paying_user
    
    current_user --> public
    active_user --> private
    admin_user --> activate_user
    paying_user --> pro_items
    ```
    
    ## Integriert mit **OpenAPI**
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:01:10 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  10. docs/hu/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 20.2K bytes
    - Viewed (0)
Back to top