Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Reference (0.27 sec)

  1. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

    ### `yield`を持つ依存関係でのコンテキストマネージャの使用
    
    !!! warning "注意"
        これは多かれ少なかれ、「高度な」発想です。
    
        **FastAPI** を使い始めたばかりの方は、とりあえずスキップした方がよいかもしれません。
    
    Pythonでは、<a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">以下の2つのメソッドを持つクラスを作成する: `__enter__()`と`__exit__()`</a>ことでコンテキストマネージャを作成することができます。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

        Wenn Sie gerade erst mit **FastAPI** beginnen, möchten Sie das vielleicht vorerst überspringen.
    
    In Python können Sie Kontextmanager erstellen, indem Sie <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">eine Klasse mit zwei Methoden erzeugen: `__enter__()` und `__exit__()`</a>.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:10:29 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    !!! warning
        This is, more or less, an "advanced" idea.
    
        If you are just starting with **FastAPI** you might want to skip it for now.
    
    In Python, you can create Context Managers by <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">creating a class with two methods: `__enter__()` and `__exit__()`</a>.
    
    You can also use them inside of **FastAPI** dependencies with `yield` by using
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

        Это более или менее "продвинутая" идея.
    
        Если вы только начинаете работать с **FastAPI**, то лучше пока пропустить этот пункт.
    
    В Python для создания менеджеров контекста можно <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">создать класс с двумя методами: `__enter__()` и `__exit__()`</a>.
    
    Вы также можете использовать их внутри зависимостей **FastAPI** с `yield`, используя операторы
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 04:21:06 GMT 2024
    - 19.6K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    当你使用`yield`创建一个依赖项时,**FastAPI**会在内部将其转换为上下文管理器,并与其他相关工具结合使用。
    
    ### 在依赖项中使用带有`yield`的上下文管理器
    
    !!! warning
        这是一个更为“高级”的想法。
    
        如果您刚开始使用**FastAPI**,您可能暂时可以跳过它。
    
    在Python中,你可以通过<a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">创建一个带有`__enter__()`和`__exit__()`方法的类</a>来创建上下文管理器。
    
    你也可以在**FastAPI**的依赖项中使用带有`yield`的`with`或`async with`语句,通过在依赖函数内部使用它们。
    
    ```Python hl_lines="1-9  13"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K bytes
    - Viewed (0)
Back to top