Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for State (0.18 sec)

  1. tests/test_dependency_contextvars.py

    legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar(
        "legacy_request_state_context_var", default=None
    )
    
    app = FastAPI()
    
    
    async def set_up_request_state_dependency():
        request_state = {"user": "deadpond"}
        contextvar_token = legacy_request_state_context_var.set(request_state)
        yield request_state
        legacy_request_state_context_var.reset(contextvar_token)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  2. docs/en/docs/reference/websockets.md

                - url
                - base_url
                - headers
                - query_params
                - path_params
                - cookies
                - client
                - state
                - url_for
                - client_state
                - application_state
                - receive
                - send
                - accept
                - receive_text
                - receive_bytes
                - receive_json
                - iter_text
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  3. docs_src/sql_databases_peewee/sql_app/database.py

    from contextvars import ContextVar
    
    import peewee
    
    DATABASE_NAME = "test.db"
    db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
    db_state = ContextVar("db_state", default=db_state_default.copy())
    
    
    class PeeweeConnectionState(peewee._ConnectionState):
        def __init__(self, **kwargs):
            super().__setattr__("_state", db_state)
            super().__init__(**kwargs)
    
        def __setattr__(self, name, value):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 662 bytes
    - Viewed (0)
  4. docs/em/docs/how-to/sql-databases-peewee.md

    ```Python
    # db._state = PeeweeConnectionState()
    ```
    
    & ๐Ÿ“ `sql_app/main.py` ๐Ÿ“, ๐Ÿค ๐Ÿ’ช `async` ๐Ÿ”— `reset_db_state()` & โŽ โšซ๏ธ โฎ๏ธ `pass`:
    
    ```Python
    async def reset_db_state():
    #     database.db._state._state.set(db_state_default.copy())
    #     database.db._state.reset()
        pass
    ```
    
    โคด๏ธ ๐Ÿƒ ๐Ÿ‘† ๐Ÿ“ฑ โฎ๏ธ Uvicorn:
    
    <div class="termy">
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  5. .github/actions/people/app/main.py

    
    class ReviewNode(BaseModel):
        author: Union[Author, None] = None
        state: str
    
    
    class Reviews(BaseModel):
        nodes: List[ReviewNode]
    
    
    class PullRequestNode(BaseModel):
        number: int
        labels: Labels
        author: Union[Author, None] = None
        title: str
        createdAt: datetime
        state: str
        comments: Comments
        reviews: Reviews
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  6. .github/actions/notify-translations/app/main.py

                    already_done_comment = comment
            logging.info(
                f"Already notified comment: {already_notified_comment}, already done comment: {already_done_comment}"
            )
    
            if pr.state == "open" and awaiting_label in label_strs:
                logging.info(
                    f"This PR seems to be a language translation and awaiting reviews: #{pr.number}"
                )
                if already_notified_comment:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  7. docs/de/docs/reference/fastapi.md

    ```python
    from fastapi import FastAPI
    ```
    
    ::: fastapi.FastAPI
        options:
            members:
                - openapi_version
                - webhooks
                - state
                - dependency_overrides
                - openapi
                - websocket
                - include_router
                - get
                - put
                - post
                - delete
                - options
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Feb 18 12:19:32 GMT 2024
    - 715 bytes
    - Viewed (0)
  8. tests/test_dependency_contextmanager.py

    class OtherDependencyError(Exception):
        pass
    
    
    async def asyncgen_state(state: Dict[str, str] = Depends(get_state)):
        state["/async"] = "asyncgen started"
        yield state["/async"]
        state["/async"] = "asyncgen completed"
    
    
    def generator_state(state: Dict[str, str] = Depends(get_state)):
        state["/sync"] = "generator started"
        yield state["/sync"]
        state["/sync"] = "generator completed"
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/sql-databases-peewee.md

    ```Python
    # db._state = PeeweeConnectionState()
    ```
    
    And in the file `sql_app/main.py` file, comment the body of the `async` dependency `reset_db_state()` and replace it with a `pass`:
    
    ```Python
    async def reset_db_state():
    #     database.db._state._state.set(db_state_default.copy())
    #     database.db._state.reset()
        pass
    ```
    
    Then run your app with Uvicorn:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/sql-databases.md

         &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ” โšซ๏ธ `finally` ๐Ÿซ.
    
        ๐Ÿ‘‰ ๐ŸŒŒ ๐Ÿ‘ฅ โš’ ๐Ÿ’ญ ๐Ÿ’ฝ ๐ŸŽ‰ ๐Ÿ•ง ๐Ÿ“ช โฎ๏ธ ๐Ÿ“จ. ๐Ÿšฅ ๐Ÿ“ค โš  โช ๐Ÿญ ๐Ÿ“จ.
    
    ### ๐Ÿ”ƒ `request.state`
    
    `request.state` ๐Ÿ  ๐Ÿ”  `Request` ๐ŸŽš. โšซ๏ธ ๐Ÿ“ค ๐Ÿช โŒ ๐ŸŽš ๐Ÿ“Ž ๐Ÿ“จ โšซ๏ธ, ๐Ÿ’– ๐Ÿ’ฝ ๐ŸŽ‰ ๐Ÿ‘‰ ๐Ÿ’ผ. ๐Ÿ‘† ๐Ÿ’ช โœ ๐ŸŒ… ๐Ÿ”ƒ โšซ๏ธ <a href="https://www.starlette.io/requests/#other-state" class="external-link" target="_blank">๐Ÿ’ƒ ๐Ÿฉบ ๐Ÿ”ƒ `Request` ๐Ÿ‡ต๐Ÿ‡ธ</a>.
    
    ๐Ÿ‘ฅ ๐Ÿ‘‰ ๐Ÿ’ผ, โšซ๏ธ โ„น ๐Ÿ‘ฅ ๐Ÿšš ๐Ÿ‘ ๐Ÿ’ฝ ๐ŸŽ‰ โš™๏ธ ๐Ÿ”˜ ๐ŸŒ ๐Ÿ“จ, &amp; โคด๏ธ ๐Ÿ” โฎ๏ธ (๐Ÿ› ๏ธ).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
Back to top