Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 112 for decorator (0.11 sec)

  1. docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    In some cases you don't really need the return value of a dependency inside your *path operation function*.
    
    Or the dependency doesn't return a value.
    
    But you still need it to be executed/solved.
    
    For those cases, instead of declaring a *path operation function* parameter with `Depends`, you can add a `list` of `dependencies` to the *path operation decorator*.
    
    ## Add `dependencies` to the *path operation decorator*
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/first-steps.md

    You put it on top of a function. Like a pretty decorative hat (I guess that's where the term came from).
    
    A "decorator" takes the function below and does something with it.
    
    In our case, this decorator tells **FastAPI** that the function below corresponds to the **path** `/` with an **operation** `get`.
    
    It is the "**path operation decorator**".
    
    ///
    
    You can also use the other operations:
    
    * `@app.post()`
    * `@app.put()`
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 26 11:48:16 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  3. docs/vi/docs/tutorial/first-steps.md

    Bạn đặt nó trên một hàm. Giống như một chiếc mũ xinh xắn (Tôi ddonas đó là lí do mà thuật ngữ này ra đời).
    
    Một "decorator" lấy một hàm bên dưới và thực hiện một vài thứ với nó.
    
    Trong trường hợp của chúng ta, decorator này nói **FastAPI** rằng hàm bên dưới ứng với **đường dẫn** `/` và một **toán tử** `get`.
    
    Nó là một "**decorator đường dẫn toán tử**".
    
    ///
    
    Bạn cũng có thể sử dụng với các toán tử khác:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/custom-response.md

    But you can also declare the `Response` that you want to be used (e.g. any `Response` subclass), in the *path operation decorator* using the `response_class` parameter.
    
    The contents that you return from your *path operation function* will be put inside of that `Response`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12K bytes
    - Viewed (0)
  5. docs/tr/docs/tutorial/first-steps.md

    Dekoratörler, dekoratif bir şapka gibi (sanırım terim buradan geliyor) fonksiyonların üzerlerine yerleştirilirler.
    
    Bir "dekoratör" hemen altında bulunan fonksiyonu alır ve o fonksiyon ile bazı işlemler gerçekleştirir.
    
    Bizim durumumuzda, kullandığımız dekoratör, **FastAPI**'a altındaki fonksiyonun `/` yoluna gelen `get` metodlu isteklerden sorumlu olduğunu söyler.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/path-operation-configuration.md

    # Path Operation Configuration
    
    There are several parameters that you can pass to your *path operation decorator* to configure it.
    
    /// warning
    
    Notice that these parameters are passed directly to the *path operation decorator*, not to your *path operation function*.
    
    ///
    
    ## Response Status Code
    
    You can define the (HTTP) `status_code` to be used in the response of your *path operation*.
    
    You can pass directly the `int` code, like `404`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  7. docs/uk/docs/tutorial/first-steps.md

    #### Визначте декоратор операції шляху (path operation decorator)
    
    ```Python hl_lines="6"
    {!../../docs_src/first_steps/tutorial001.py!}
    ```
    Декоратор `@app.get("/")` вказує **FastAPI**, що функція нижче, відповідає за обробку запитів, які надходять до неї:
    
    * шлях `/`
    * використовуючи <abbr title="an HTTP GET method"><code>get</code> операцію</abbr>
    
    /// info | "`@decorator` Додаткова інформація"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/response-model.md

    In those cases, you can use the *path operation decorator* parameter `response_model` instead of the return type.
    
    You can use the `response_model` parameter in any of the *path operations*:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * etc.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 18.1K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/first-steps.md

    #### Определите *декоратор операции пути (path operation decorator)*
    
    ```Python hl_lines="6"
    {!../../docs_src/first_steps/tutorial001.py!}
    ```
    
    Декоратор `@app.get("/")` указывает **FastAPI**, что функция, прямо под ним, отвечает за обработку запросов, поступающих по адресу:
    
    * путь `/`
    * использующих <abbr title="HTTP GET метод"><code>get</code> операцию</abbr>
    
    /// info | "`@decorator` Дополнительная информация"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/openapi-callbacks.md

    ///
    
    The only new thing is the `callbacks=invoices_callback_router.routes` as an argument to the *path operation decorator*. We'll see what that is next.
    
    ## Documenting the callback
    
    The actual callback code will depend heavily on your own API app.
    
    And it will probably vary a lot from one app to the next.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.7K bytes
    - Viewed (0)
Back to top