Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for checker (0.14 sec)

  1. docs/zh/docs/advanced/advanced-dependencies.md

    ```Python hl_lines="16"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    这样就可以**参数化**依赖项,它包含 `checker.fixed_content` 的属性 - `"bar"`。
    
    ## 把实例作为依赖项
    
    然后,不要再在 `Depends(checker)` 中使用 `Depends(FixedContentQueryChecker)`, 而是要使用 `checker`,因为依赖项是类实例 - `checker`,不是类。
    
    处理依赖项时,**FastAPI** 以如下方式调用 `checker`:
    
    ```Python
    checker(q="somequery")
    ```
    
    ……并用*路径操作函数*的参数 `fixed_content_included` 返回依赖项的值:
    
    ```Python hl_lines="20"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jan 28 18:26:57 GMT 2024
    - 2K bytes
    - Viewed (0)
  2. docs/em/docs/advanced/advanced-dependencies.md

    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    & 👈 🌌 👥 💪 "🔗" 👆 🔗, 👈 🔜 ✔️ `"bar"` 🔘 ⚫️, 🔢 `checker.fixed_content`.
    
    ## ⚙️ 👐 🔗
    
    ⤴️, 👥 💪 ⚙️ 👉 `checker` `Depends(checker)`, ↩️ `Depends(FixedContentQueryChecker)`, ↩️ 🔗 👐, `checker`, 🚫 🎓 ⚫️.
    
    & 🕐❔ ❎ 🔗, **FastAPI** 🔜 🤙 👉 `checker` 💖:
    
    ```Python
    checker(q="somequery")
    ```
    
    ...& 🚶‍♀️ ⚫️❔ 👈 📨 💲 🔗 👆 *➡ 🛠️ 🔢* 🔢 `fixed_content_included`:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial011.py

        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    async def read_query_check(fixed_content_included: bool = Depends(checker)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 504 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial011_an_py39.py

        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    async def read_query_check(fixed_content_included: Annotated[bool, Depends(checker)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 544 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial011_an.py

        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    async def read_query_check(fixed_content_included: Annotated[bool, Depends(checker)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 554 bytes
    - Viewed (0)
  6. docs/de/docs/advanced/advanced-dependencies.md

    ## Die Instanz als Abhängigkeit verwenden
    
    Dann könnten wir diesen `checker` in einem `Depends(checker)` anstelle von `Depends(FixedContentQueryChecker)` verwenden, da die Abhängigkeit die Instanz `checker` und nicht die Klasse selbst ist.
    
    Und beim Auflösen der Abhängigkeit ruft **FastAPI** diesen `checker` wie folgt auf:
    
    ```Python
    checker(q="somequery")
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:18:49 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/advanced-dependencies.md

    ## Use the instance as a dependency
    
    Then, we could use this `checker` in a `Depends(checker)`, instead of `Depends(FixedContentQueryChecker)`, because the dependency is the instance, `checker`, not the class itself.
    
    And when solving the dependency, **FastAPI** will call this `checker` like:
    
    ```Python
    checker(q="somequery")
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/response-model.md

    But you might want to still keep the return type annotation in the function to get the support from tools like editors and type checkers (e.g. mypy).
    
    In this case, you can disable the response model generation by setting `response_model=None`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="7"
    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)
  9. docs/fr/docs/async.md

    Vous attendez donc que votre crush 😍 finisse son histoire, souriez gentiment et dites que vous allez chercher les burgers ⏸.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 24K bytes
    - Viewed (0)
  10. docs/en/docs/release-notes.md

    ### Migration
    
    Check out the [Pydantic migration guide](https://docs.pydantic.dev/2.0/migration/).
    
    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)
Back to top