Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 255 for iter (0.13 sec)

  1. docs/zh/docs/tutorial/sql-databases.md

        有关更多详细信息,请返回教程中的安全部分。
    
        在这里,我们只关注数据库的工具和机制。
    
    !!! tip
        这里不是将每个关键字参数传递给Item并从Pydantic模型中读取每个参数,而是先生成一个字典,其中包含Pydantic模型的数据:
    
        `item.dict()`
    
        然后我们将dict的键值对 作为关键字参数传递给 SQLAlchemy `Item`:
    
        `Item(**item.dict())`
    
        然后我们传递 Pydantic模型未提供的额外关键字参数`owner_id`:
    
        `Item(**item.dict(), owner_id=user_id)`
    
    ## 主**FastAPI**应用程序
    
    现在在`sql_app/main.py`文件中 让我们集成和使用我们之前创建的所有其他部分。
    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)
  2. docs/en/docs/advanced/dataclasses.md

    2. `pydantic.dataclasses` is a drop-in replacement for `dataclasses`.
    
    3. The `Author` dataclass includes a list of `Item` dataclasses.
    
    4. The `Author` dataclass is used as the `response_model` parameter.
    
    5. You can use other standard type annotations with dataclasses as the request body.
    
        In this case, it's a list of `Item` dataclasses.
    
    6. Here we are returning a dictionary that contains `items` which is a list of dataclasses.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  3. docs/fr/docs/advanced/additional-responses.md

                        "message": {
                            "title": "Message",
                            "type": "string"
                        }
                    }
                },
                "Item": {
                    "title": "Item",
                    "required": [
                        "id",
                        "value"
                    ],
                    "type": "object",
                    "properties": {
    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)
  4. docs/ja/docs/tutorial/response-model.md

    #### デフォルト値を持つフィールドの値を持つデータ
    
    しかし、ID`bar`のitemのように、デフォルト値が設定されているモデルのフィールドに値が設定されている場合:
    
    ```Python hl_lines="3 5"
    {
        "name": "Bar",
        "description": "The bartenders",
        "price": 62,
        "tax": 20.2
    }
    ```
    
    それらはレスポンスに含まれます。
    
    #### デフォルト値と同じ値を持つデータ
    
    ID`baz`のitemのようにデフォルト値と同じ値を持つデータの場合:
    
    ```Python hl_lines="3 5 6"
    {
        "name": "Baz",
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/body.md

        ```
    
    ...그리고 만들어낸 모델인 `Item`으로 타입을 선언합니다.
    
    ## 결과
    
    위에서의 단순한 파이썬 타입 선언으로, **FastAPI**는 다음과 같이 동작합니다:
    
    * 요청의 본문을 JSON으로 읽어 들입니다.
    * (필요하다면) 대응되는 타입으로 변환합니다.
    * 데이터를 검증합니다.
        * 만약 데이터가 유효하지 않다면, 정확히 어떤 것이 그리고 어디에서 데이터가 잘 못 되었는지 지시하는 친절하고 명료한 에러를 반환할 것입니다.
    * 매개변수 `item`에 포함된 수신 데이터를 제공합니다.
        * 함수 내에서 매개변수를 `Item` 타입으로 선언했기 때문에, 모든 어트리뷰트와 그에 대한 타입에 대한 편집기 지원(완성 등)을 또한 받을 수 있습니다.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_dependencies/test_tutorial012_an.py

                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == [{"item": "Portal Gun"}, {"item": "Plumbus"}]
    
    
    def test_get_valid_headers_users():
        response = client.get(
            "/users/",
            headers={
                "X-Token": "fake-super-secret-token",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/query-params-str-validations.md

        {!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!}
        ```
    
    ## 📛 🔢
    
    🌈 👈 👆 💚 🔢 `item-query`.
    
    💖:
    
    ```
    http://127.0.0.1:8000/items/?item-query=foobaritems
    ```
    
    ✋️ `item-query` 🚫 ☑ 🐍 🔢 📛.
    
    🔐 🔜 `item_query`.
    
    ✋️ 👆 💪 ⚫️ ⚫️❔ `item-query`...
    
    ⤴️ 👆 💪 📣 `alias`, & 👈 📛 ⚫️❔ 🔜 ⚙️ 🔎 🔢 💲:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  8. docs/ru/docs/deployment/docker.md

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @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}
    ```
    
    ### Dockerfile
    
    В этой же директории создайте файл `Dockerfile` и заполните его:
    
    ```{ .dockerfile .annotate }
    # (1)
    FROM python:3.9
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 57.5K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/response-model.md

    ```Python hl_lines="3  5"
    {
        "name": "Bar",
        "description": "The bartenders",
        "price": 62,
        "tax": 20.2
    }
    ```
    
    they will be included in the response.
    
    #### Data with the same values as the defaults
    
    If the data has the same values as the default ones, like the item with ID `baz`:
    
    ```Python hl_lines="3  5-6"
    {
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  10. docs_src/security/tutorial004.py

        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(current_user: User = Depends(get_current_active_user)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
Back to top