Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ContextVar (0.18 sec)

  1. docs/en/docs/how-to/sql-databases-peewee.md

    There are several things to keep in mind.
    
    The `ContextVar` has to be created at the top of the module, like:
    
    ```Python
    some_var = ContextVar("some_var", default="default value")
    ```
    
    To set a value used in the current "context" (e.g. for the current request) use:
    
    ```Python
    some_var.set("new value")
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (1)
  2. docs/em/docs/how-to/sql-databases-peewee.md

    📤 📚 👜 ✔️ 🤯.
    
    `ContextVar` ✔️ ✍ 🔝 🕹, 💖:
    
    ```Python
    some_var = ContextVar("some_var", default="default value")
    ```
    
    ⚒ 💲 ⚙️ ⏮️ "🔑" (✅ ⏮️ 📨) ⚙️:
    
    ```Python
    some_var.set("new value")
    ```
    
    🤚 💲 🙆 🔘 🔑 (✅ 🙆 🍕 🚚 ⏮️ 📨) ⚙️:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  3. docs/en/docs/release-notes.md

    ```Python
    from contextvars import ContextVar
    from typing import Any, Dict, Optional
    
    
    legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar(
        "legacy_request_state_context_var", default=None
    )
    
    async def set_up_request_state_dependency():
        request_state = {"user": "deadpond"}
        contextvar_token = legacy_request_state_context_var.set(request_state)
    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