- Sort Score
- Result 10 results
- Languages All
Results 21 - 28 of 28 for put_user (0.41 sec)
-
tests/test_route_scope.py
from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect from fastapi.routing import APIRoute, APIWebSocketRoute from fastapi.testclient import TestClient app = FastAPI() @app.get("/users/{user_id}") async def get_user(user_id: str, request: Request): route: APIRoute = request.scope["route"] return {"user_id": user_id, "path": route.path} @app.websocket("/items/{item_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Feb 08 10:23:07 UTC 2023 - 1.5K bytes - Viewed (0) -
tests/test_dependency_contextvars.py
): response = await call_next(request) response.headers["custom"] = "foo" return response @app.get("/user", dependencies=[Depends(set_up_request_state_dependency)]) def get_user(): request_state = legacy_request_state_context_var.get() assert request_state return request_state["user"] client = TestClient(app) def test_dependency_contextvars(): """
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Feb 17 12:40:12 UTC 2022 - 1.5K bytes - Viewed (0) -
docs_src/sql_databases_peewee/sql_app/crud.py
from . import models, schemas def get_user(user_id: int): return models.User.filter(models.User.id == user_id).first() def get_user_by_email(email: str): return models.User.filter(models.User.email == email).first() def get_users(skip: int = 0, limit: int = 100): return list(models.User.select().offset(skip).limit(limit)) def create_user(user: schemas.UserCreate):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 843 bytes - Viewed (0) -
.github/ISSUE_TEMPLATE/tflite-converter-issue.md
#### Option A: Reference colab notebooks 1) Reference [TensorFlow Model Colab](https://colab.research.google.com/gist/ymodak/e96a4270b953201d5362c61c1e8b78aa/tensorflow-datasets.ipynb?authuser=1): Demonstrate how to build your TF model.
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Wed Jun 15 03:35:58 UTC 2022 - 2.1K bytes - Viewed (0) -
docs_src/sql_databases_peewee/sql_app/main.py
users = crud.get_users(skip=skip, limit=limit) return users @app.get( "/users/{user_id}", response_model=schemas.User, dependencies=[Depends(get_db)] ) def read_user(user_id: int): db_user = crud.get_user(user_id=user_id) if db_user is None: raise HTTPException(status_code=404, detail="User not found") return db_user @app.post( "/users/{user_id}/items/", response_model=schemas.Item,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 2.2K bytes - Viewed (0) -
tests/test_infer_param_optionality.py
app = FastAPI() user_router = APIRouter() item_router = APIRouter() @user_router.get("/") def get_users(): return [{"user_id": "u1"}, {"user_id": "u2"}] @user_router.get("/{user_id}") def get_user(user_id: str): return {"user_id": user_id} @item_router.get("/") def get_items(user_id: Optional[str] = None): if user_id is None:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 13.3K bytes - Viewed (0) -
docs/em/docs/tutorial/sql-databases.md
{!> ../../docs_src/sql_databases/sql_app_py39/main.py!} ``` //// 👥 🏗 💽 🎉 ⏭ 🔠 📨 🔗 ⏮️ `yield`, & ⤴️ 📪 ⚫️ ⏮️. & ⤴️ 👥 💪 ✍ 🚚 🔗 *➡ 🛠️ 🔢*, 🤚 👈 🎉 🔗. ⏮️ 👈, 👥 💪 🤙 `crud.get_user` 🔗 ⚪️➡️ 🔘 *➡ 🛠️ 🔢* & ⚙️ 👈 🎉. /// tip 👀 👈 💲 👆 📨 🇸🇲 🏷, ⚖️ 📇 🇸🇲 🏷.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 25K bytes - Viewed (0) -
docs/zh/docs/tutorial/sql-databases.md
{!> ../../docs_src/sql_databases/sql_app/main.py!} ``` //// 我们在依赖项中的每个请求之前利用`yield`创建数据库会话,然后关闭它。 所以我们就可以在*路径操作函数*中创建需要的依赖,就能直接获取会话。 这样,我们就可以直接从*路径操作函数*内部调用`crud.get_user`并使用该会话,来进行对数据库操作。 /// tip 请注意,您返回的值是 SQLAlchemy 模型或 SQLAlchemy 模型列表。 但是由于所有路径操作的response_model都使用 Pydantic模型/使用orm_mode模式,因此您的 Pydantic 模型中声明的数据将从它们中提取并返回给客户端,并进行所有正常的过滤和验证。 /// /// tip
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 27.1K bytes - Viewed (0)