- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 29 for State (0.18 sec)
-
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) -
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) -
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) -
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) -
.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) -
.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) -
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) -
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) -
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) -
docs/em/docs/tutorial/sql-databases.md
& โคด๏ธ ๐ฅ ๐ โซ๏ธ `finally` ๐ซ. ๐ ๐ ๐ฅ โ ๐ญ ๐ฝ ๐ ๐ง ๐ช โฎ๏ธ ๐จ. ๐ฅ ๐ค โ โช ๐ญ ๐จ. ### ๐ `request.state` `request.state` ๐ ๐ `Request` ๐. โซ๏ธ ๐ค ๐ช โ ๐ ๐ ๐จ โซ๏ธ, ๐ ๐ฝ ๐ ๐ ๐ผ. ๐ ๐ช โ ๐ ๐ โซ๏ธ <a href="https://www.starlette.io/requests/#other-state" class="external-link" target="_blank">๐ ๐ฉบ ๐ `Request` ๐ต๐ธ</a>. ๐ฅ ๐ ๐ผ, โซ๏ธ โน ๐ฅ ๐ ๐ ๐ฝ ๐ โ๏ธ ๐ ๐ ๐จ, & โคด๏ธ ๐ โฎ๏ธ (๐ ๏ธ).
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)