Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 116 for Item (0.16 sec)

  1. tests/test_tutorial/test_body/test_tutorial001_py310.py

                            },
                        },
                        "summary": "Create Item",
                        "operationId": "create_item_items__post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {"$ref": "#/components/schemas/Item"}
                                }
                            },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (2)
  2. tests/test_tutorial/test_body/test_tutorial001.py

                            },
                        },
                        "summary": "Create Item",
                        "operationId": "create_item_items__post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {"$ref": "#/components/schemas/Item"}
                                }
                            },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (7)
  3. docs/ja/docs/tutorial/handling-errors.md

    ```
    
    ### レスポンス結果
    
    クライアントが`http://example.com/items/foo`(`item_id` `"foo"`)をリクエストすると、HTTPステータスコードが200で、以下のJSONレスポンスが返されます:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    しかし、クライアントが`http://example.com/items/bar`(存在しない`item_id` `"bar"`)をリクエストした場合、HTTPステータスコード404("not found"エラー)と以下のJSONレスポンスが返されます:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    !!! tip "豆知識"
    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)
  4. 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)
  5. docs/ja/docs/tutorial/query-params-str-validations.md

    {!../../../docs_src/query_params_str_validations/tutorial008.py!}
    ```
    
    ## エイリアスパラメータ
    
    パラメータに`item-query`を指定するとします.
    
    以下のような感じです:
    
    ```
    http://127.0.0.1:8000/items/?item-query=foobaritems
    ```
    
    しかし、`item-query`は有効なPythonの変数名ではありません。
    
    最も近いのは`item_query`でしょう。
    
    しかし、どうしても`item-query`と正確に一致している必要があるとします...
    
    それならば、`alias`を宣言することができます。エイリアスはパラメータの値を見つけるのに使用されます:
    
    ```Python hl_lines="9"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 10.5K bytes
    - Viewed (1)
  6. tests/test_schema_extra_examples.py

            @app.get("/path_example/{item_id}")
            def path_example(
                item_id: str = Path(
                    example="item_1",
                ),
            ):
                return item_id
    
        @app.get("/path_examples/{item_id}")
        def path_examples(
            item_id: str = Path(
                examples=["item_1", "item_2"],
            ),
        ):
            return item_id
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

    @needs_pydanticv1
    def test_create_item(client):
        item = {"title": "Foo", "description": "Something that fights"}
        response = client.post("/users/1/items/", json=item)
        assert response.status_code == 200, response.text
        item_data = response.json()
        assert item["title"] == item_data["title"]
        assert item["description"] == item_data["description"]
        assert "id" in item_data
        assert "owner_id" in item_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_sql_databases/test_sql_databases.py

    @needs_pydanticv1
    def test_create_item(client):
        item = {"title": "Foo", "description": "Something that fights"}
        response = client.post("/users/1/items/", json=item)
        assert response.status_code == 200, response.text
        item_data = response.json()
        assert item["title"] == item_data["title"]
        assert item["description"] == item_data["description"]
        assert "id" in item_data
        assert "owner_id" in item_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  9. docs/hu/docs/index.md

    Próbáld kicserélni a következő sorban:
    
    ```Python
        return {"item_name": item.name, "item_id": item_id}
    ```
    
    ...ezt:
    
    ```Python
            ... "item_name": item.name ...
    ```
    
    ...erre:
    
    ```Python
            ... "item_price": item.price ...
    ```
    
    ... És figyeld meg hogy a szerkesztő automatikusan tudni fogja a típusokat és kiegészíti azokat:
    
    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)
  10. docs/es/docs/index.md

    Intenta cambiando la línea a:
    
    ```Python
        return {"item_name": item.name, "item_id": item_id}
    ```
    
    ...de:
    
    ```Python
            ... "item_name": item.name ...
    ```
    
    ...a:
    
    ```Python
            ... "item_price": item.price ...
    ```
    
    ... y mira como el editor va a auto-completar los atributos y sabrá sus tipos:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 19K bytes
    - Viewed (0)
Back to top