Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 249 for Items (0.13 sec)

  1. docs/en/docs/tutorial/bigger-applications.md

    * look for the subpackage `routers` (the directory at `app/routers/`)...
    * and from it, import the submodule `items` (the file at `app/routers/items.py`) and `users` (the file at `app/routers/users.py`)...
    
    The module `items` will have a variable `router` (`items.router`). This is the same one we created in the file `app/routers/items.py`, it's an `APIRouter` object.
    
    And then we do the same for the module `users`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. tests/test_openapi_separate_input_output_schemas.py

        app = FastAPI(separate_input_output_schemas=separate_input_output_schemas)
    
        @app.post("/items/")
        def create_item(item: Item):
            return item
    
        @app.post("/items-list/")
        def create_item_list(item: List[Item]):
            return item
    
        @app.get("/items/")
        def read_items() -> List[Item]:
            return [
                Item(
                    name="Portal Gun",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 18.4K bytes
    - Viewed (2)
  3. docs/zh/docs/tutorial/bigger-applications.md

    ## 其他使用 `APIRouter` 的模块
    
    假设你在位于 `app/routers/items.py` 的模块中还有专门用于处理应用程序中「项目」的端点。
    
    你具有以下*路径操作*:
    
    * `/items/`
    * `/items/{item_id}`
    
    这和 `app/routers/users.py` 的结构完全相同。
    
    但是我们想变得更聪明并简化一些代码。
    
    我们知道此模块中的所有*路径操作*都有相同的:
    
    * 路径 `prefix`:`/items`。
    * `tags`:(仅有一个 `items` 标签)。
    * 额外的 `responses`。
    * `dependencies`:它们都需要我们创建的 `X-Token` 依赖项。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dataclasses/test_tutorial003.py

            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/authors/{author_id}/items/": {
                    "post": {
                        "summary": "Create Author Items",
                        "operationId": "create_author_items_authors__author_id__items__post",
                        "parameters": [
                            {
                                "required": True,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 12.1K bytes
    - Viewed (0)
  5. tests/test_infer_param_optionality.py

    
    def test_get_items_1():
        """Check that /items returns expected data"""
        response = client.get("/items")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {"item_id": "i1", "user_id": "u1"},
            {"item_id": "i2", "user_id": "u2"},
        ]
    
    
    def test_get_items_2():
        """Check that /items returns expected data with user_id specified"""
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

                                        "schema": {
                                            "title": "Response Read Items Items  Get",
                                            "type": "array",
                                            "items": {"$ref": "#/components/schemas/Item"},
                                        }
                                    }
                                },
                            },
    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)
  7. tests/test_tutorial/test_sql_databases/test_sql_databases.py

        user_data = response.json()
        item_to_check = [it for it in user_data["items"] if it["id"] == item_data["id"]][0]
        assert item_to_check["title"] == item["title"]
        assert item_to_check["description"] == item["description"]
    
    
    # TODO: pv2 add Pydantic v2 version
    @needs_pydanticv1
    def test_read_items(client):
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        data = response.json()
    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)
  8. tests/test_extra_routes.py

        name: str
        price: Optional[float] = None
    
    
    @app.api_route("/items/{item_id}", methods=["GET"])
    def get_items(item_id: str):
        return {"item_id": item_id}
    
    
    def get_not_decorated(item_id: str):
        return {"item_id": item_id}
    
    
    app.add_api_route("/items-not-decorated/{item_id}", get_not_decorated)
    
    
    @app.delete("/items/{item_id}")
    def delete_item(item_id: str, item: Item):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/bigger-applications.md

    * Suche nach dem Subpackage `routers` (das Verzeichnis unter `app/routers/`) ...
    * und importiere daraus die Submodule `items` (die Datei unter `app/routers/items.py`) und `users` (die Datei unter `app/routers/users.py`) ...
    
    Das Modul `items` verfügt über eine Variable `router` (`items.router`). Das ist dieselbe, die wir in der Datei `app/routers/items.py` erstellt haben, es ist ein `APIRouter`-Objekt.
    
    Und dann machen wir das gleiche für das Modul `users`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:27:59 GMT 2024
    - 21.1K bytes
    - Viewed (0)
  10. tests/test_tuples.py

                                "items": {"$ref": "#/components/schemas/ValidationError"},
                            }
                        },
                    },
                    "ItemGroup": {
                        "title": "ItemGroup",
                        "required": ["items"],
                        "type": "object",
                        "properties": {
                            "items": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.8K bytes
    - Viewed (0)
Back to top