Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 180 for function (0.16 sec)

  1. docs/en/docs/release-notes.md

    * Add note in [Response Model docs](https://fastapi.tiangolo.com/tutorial/response-model/) about why using a function parameter instead of a function return type annotation. PR [#109](https://github.com/tiangolo/fastapi/pull/109) by [@JHSaunders](https://github.com/JHSaunders).
    
    * Fix event docs (startup/shutdown) function name. PR [#105](https://github.com/tiangolo/fastapi/pull/105) by [@stratosgear](https://github.com/stratosgear).
    
    ## 0.10.2
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  2. docs/en/docs/advanced/testing-dependencies.md

    For these cases, your **FastAPI** application has an attribute `app.dependency_overrides`, it is a simple `dict`.
    
    To override a dependency for testing, you put as a key the original dependency (a function), and as the value, your dependency override (another function).
    
    And then **FastAPI** will call that override instead of the original dependency.
    
    === "Python 3.10+"
    
        ```Python hl_lines="26-27  30"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  3. docs_src/generate_clients/tutorial003.py

    from fastapi.routing import APIRoute
    from pydantic import BaseModel
    
    
    def custom_generate_unique_id(route: APIRoute):
        return f"{route.tags[0]}-{route.name}"
    
    
    app = FastAPI(generate_unique_id_function=custom_generate_unique_id)
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    class ResponseMessage(BaseModel):
        message: str
    
    
    class User(BaseModel):
        username: str
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 04 22:02:18 GMT 2022
    - 939 bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/settings.md

    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
            function ->> execute: 执行函数代码
            execute ->> code: 返回结果
        end
    
        rect rgba(0, 255, 255, .1)
            code ->> function: say_hi(name="Camila")
            function ->> code: 返回存储的结果
        end
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/security/first-steps.md

    ```
    
    そのため、`Depends`と一緒に使うことができます。
    
    ### 使い方
    
    これで`oauth2_scheme`を`Depends`で依存関係に渡すことができます。
    
    ```Python hl_lines="10"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    この依存関係は、*path operation function*のパラメーター`token`に代入される`str`を提供します。
    
    **FastAPI**は、この依存関係を使用してOpenAPIスキーマ (および自動APIドキュメント) で「セキュリティスキーム」を定義できることを知っています。
    
    !!! info "技術詳細"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  6. docs/fr/docs/tutorial/path-params.md

    ```Python hl_lines="6  11"
    {!../../../docs_src/path_params/tutorial003.py!}
    ```
    
    Sinon, le chemin `/users/{user_id}` correspondrait aussi à `/users/me`, la fonction "croyant" qu'elle a reçu un paramètre `user_id` avec pour valeur `"me"`.
    
    ## Valeurs prédéfinies
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10K bytes
    - Viewed (0)
  7. fastapi/routing.py

                    current_generate_unique_id = get_value_or_default(
                        route.generate_unique_id_function,
                        router.generate_unique_id_function,
                        generate_unique_id_function,
                        self.generate_unique_id_function,
                    )
                    self.add_api_route(
                        prefix + route.path,
                        route.endpoint,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  8. docs_src/websockets/tutorial002_py310.py

            </ul>
            <script>
            var ws = null;
                function connect(event) {
                    var itemId = document.getElementById("itemId")
                    var token = document.getElementById("token")
                    ws = new WebSocket("ws://localhost:8000/items/" + itemId.value + "/ws?token=" + token.value);
                    ws.onmessage = function(event) {
                        var messages = document.getElementById('messages')
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2.7K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/request-files.md

    As all these methods are `async` methods, you need to "await" them.
    
    For example, inside of an `async` *path operation function* you can get the contents with:
    
    ```Python
    contents = await myfile.read()
    ```
    
    If you are inside of a normal `def` *path operation function*, you can access the `UploadFile.file` directly, for example:
    
    ```Python
    contents = myfile.file.read()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    The key factor is that a dependency should be a "callable".
    
    A "**callable**" in Python is anything that Python can "call" like a function.
    
    So, if you have an object `something` (that might _not_ be a function) and you can "call" it (execute it) like:
    
    ```Python
    something()
    ```
    
    or
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    then it is a "callable".
    
    ## Classes as dependencies
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
Back to top