Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 238 for ID (0.14 sec)

  1. tests/test_tutorial/test_bigger_applications/test_main_an_py39.py

                },
                "/items/{item_id}": {
                    "get": {
                        "tags": ["items"],
                        "summary": "Read Item",
                        "operationId": "read_item_items__item_id__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Item Id", "type": "string"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.9K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/sql-databases.md

        它不使用之前的`:`来类型声明。
    
        这是设置配置值,而不是声明类型。
    
    Pydantic`orm_mode`将告诉 Pydantic*模型*读取数据,即它不是一个`dict`,而是一个 ORM 模型(或任何其他具有属性的任意对象)。
    
    这样,而不是仅仅试图从`dict`上 `id` 中获取值,如下所示:
    
    ```Python
    id = data["id"]
    ```
    
    尝试从属性中获取它,如:
    
    ```Python
    id = data.id
    ```
    
    有了这个,Pydantic*模型*与 ORM 兼容,您只需在*路径操作*`response_model`的参数中声明它即可。
    
    您将能够返回一个数据库模型,它将从中读取数据。
    
    #### ORM 模式的技术细节
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  3. docs/vi/docs/features.md

    # and get editor support inside the function
    def main(user_id: str):
        return user_id
    
    
    # A Pydantic model
    class User(BaseModel):
        id: int
        name: str
        joined: date
    ```
    
    Sau đó có thể được sử dụng:
    
    ```Python
    my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
    
    second_user_data = {
        "id": 4,
        "name": "Mary",
        "joined": "2018-11-30",
    }
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/handling-errors.md

    本例中,客户端用 `ID` 请求的 `item` 不存在时,触发状态码为 `404` 的异常:
    
    ```Python hl_lines="11"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    
    ```
    
    ### 响应结果
    
    请求为 `http://example.com/items/foo`(`item_id` 为 `「foo」`)时,客户端会接收到 HTTP 状态码 - 200 及如下 JSON 响应结果:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  5. docs/de/docs/advanced/openapi-callbacks.md

    In diesem Fall ist es der `str`:
    
    ```Python
    "{$callback_url}/invoices/{$request.body.id}"
    ```
    
    Wenn Ihr API-Benutzer (der externe Entwickler) also einen Request an *Ihre API* sendet, via:
    
    ```
    https://yourapi.com/invoices/?callback_url=https://www.external.org/events
    ```
    
    mit einem JSON-Körper:
    
    ```JSON
    {
        "id": "2expen51ve",
        "customer": "Mr. Richie Rich",
        "total": "9999"
    }
    ```
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:23 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_an.py

                            "scope": {"title": "Scope", "type": "string", "default": ""},
                            "client_id": IsDict(
                                {
                                    "title": "Client Id",
                                    "anyOf": [{"type": "string"}, {"type": "null"}],
                                }
                            )
                            | IsDict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  7. .github/workflows/test.yml

              python-version: "3.11"
              # Issue ref: https://github.com/actions/setup-python/issues/436
              # cache: "pip"
              # cache-dependency-path: pyproject.toml
          - uses: actions/cache@v4
            id: cache
            with:
              path: ${{ env.pythonLocation }}
    Others
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 4.4K bytes
    - Viewed (2)
  8. docs/em/docs/advanced/openapi-callbacks.md

    👉 💼, ⚫️ `str`:
    
    ```Python
    "{$callback_url}/invoices/{$request.body.id}"
    ```
    
    , 🚥 👆 🛠️ 👩‍💻 (🔢 👩‍💻) 📨 📨 *👆 🛠️* :
    
    ```
    https://yourapi.com/invoices/?callback_url=https://www.external.org/events
    ```
    
    ⏮️ 🎻 💪:
    
    ```JSON
    {
        "id": "2expen51ve",
        "customer": "Mr. Richie Rich",
        "total": "9999"
    }
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  9. docs/fr/docs/advanced/additional-responses.md

                },
                "Item": {
                    "title": "Item",
                    "required": [
                        "id",
                        "value"
                    ],
                    "type": "object",
                    "properties": {
                        "id": {
                            "title": "Id",
                            "type": "string"
                        },
                        "value": {
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/handling-errors.md

    値を返す`return`よりも例外を発生させることの利点は、「依存関係とセキュリティ」のセクションでより明確になります。
    
    この例では、クライアントが存在しないIDでアイテムを要求した場合、`404`のステータスコードを持つ例外を発生させます:
    
    ```Python hl_lines="11"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    ```
    
    ### レスポンス結果
    
    クライアントが`http://example.com/items/foo`(`item_id` `"foo"`)をリクエストすると、HTTPステータスコードが200で、以下のJSONレスポンスが返されます:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.8K bytes
    - Viewed (0)
Back to top