- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for again (0.12 sec)
-
docs_src/dependencies/tutorial008c_an.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("Oops, we didn't raise again, Britney 😱") @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 710 bytes - Viewed (0) -
fastapi/param_functions.py
the dependency is declared again for the rest of the request (for example if the dependency is needed by several dependencies), the value will be re-used for the rest of the request. Set `use_cache` to `False` to disable this behavior and ensure the dependency is called again (if declared more than once) in the same request. """
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 62.5K bytes - Viewed (0) -
tests/test_default_response_class_router.py
router_a_a = APIRouter() router_a_b_override = APIRouter() # Overrides default class router_b_override = APIRouter() # Overrides default class router_b_a = APIRouter() router_b_a_c_override = APIRouter() # Overrides default class again @app.get("/") def get_root(): return {"msg": "Hello World"} @app.get("/override", response_class=PlainTextResponse) def get_path_override(): return "Hello World" @router_a.get("/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Mar 01 20:49:20 GMT 2020 - 5K bytes - Viewed (0) -
docs_src/dependencies/tutorial008c_an_py39.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("Oops, we didn't raise again, Britney 😱") @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 700 bytes - Viewed (0) -
docs_src/dependencies/tutorial008d.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again 😎") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: str = Depends(get_username)): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 694 bytes - Viewed (0) -
docs_src/dependencies/tutorial008d_an.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again 😎") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 744 bytes - Viewed (0) -
docs_src/dependencies/tutorial008d_an_py39.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again 😎") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 734 bytes - Viewed (0) -
docs_src/dependencies/tutorial008c.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("Oops, we didn't raise again, Britney 😱") @app.get("/items/{item_id}") def get_item(item_id: str, username: str = Depends(get_username)): if item_id == "portal-gun": raise InternalError(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 660 bytes - Viewed (0) -
tests/test_tutorial/test_extending_openapi/test_tutorial001.py
"summary": "Read Items", "operationId": "read_items_items__get", } } }, } openapi_schema = response.json() # Request again to test the custom cache response = client.get("/openapi.json") assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.5K bytes - Viewed (0) -
tests/test_default_response_class.py
router_a_a = APIRouter() router_a_b_override = APIRouter() # Overrides default class router_b_override = APIRouter() # Overrides default class router_b_a = APIRouter() router_b_a_c_override = APIRouter() # Overrides default class again @app.get("/") def get_root(): return {"msg": "Hello World"} @app.get("/override", response_class=PlainTextResponse) def get_path_override(): return "Hello World" @router_a.get("/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Mar 01 20:49:20 GMT 2020 - 5.2K bytes - Viewed (0)