Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for userId (0.34 sec)

  1. docs_src/response_model/tutorial003.py

    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserOut(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user: UserIn) -> Any:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 450 bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/extra-models.md

    ```Python
    user_dict = user_in.dict()
    UserInDB(**user_dict)
    ```
    
    будет равнозначен такому:
    
    ```Python
    UserInDB(**user_in.dict())
    ```
    
    ...потому что `user_in.dict()` - это `dict`, и затем мы указываем, чтобы Python его "распаковал", когда передаём его в `UserInDB` и ставим перед ним `**`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/extra-models.md

    ```
    
    Or more exactly, using `user_dict` directly, with whatever contents it might have in the future:
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        password = user_dict["password"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
    )
    ```
    
    #### A Pydantic model from the contents of another
    
    As in the example above we got `user_dict` from `user_in.dict()`, this code:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  4. docs/de/docs/tutorial/security/get-current-user.md

        ```
    
    ## Eine `get_current_user`-Abhängigkeit erstellen
    
    Erstellen wir eine Abhängigkeit `get_current_user`.
    
    Erinnern Sie sich, dass Abhängigkeiten Unterabhängigkeiten haben können?
    
    `get_current_user` wird seinerseits von `oauth2_scheme` abhängen, das wir zuvor erstellt haben.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:08:05 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  5. docs_src/response_model/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    # Don't do this in production!
    @app.post("/user/")
    async def create_user(user: UserIn) -> UserIn:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 318 bytes
    - Viewed (0)
  6. docs_src/path_params/tutorial003b.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/users")
    async def read_users():
        return ["Rick", "Morty"]
    
    
    @app.get("/users")
    async def read_users2():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 16:16:16 GMT 2022
    - 193 bytes
    - Viewed (0)
  7. tests/test_route_scope.py

    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}")
    async def websocket_item(item_id: str, websocket: WebSocket):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 08 10:23:07 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/response-model.md

    !!! note "기술 세부사항"
        응답 모델은 함수의 타입 어노테이션 대신 이 매개변수로 선언하는데, 경로 함수가 실제 응답 모델을 반환하지 않고 `dict`, 데이터베이스 객체나 기타 다른 모델을 `response_model`을 사용하여 필드 제한과 직렬화를 수행하고 반환할 수 있기 때문입니다
    
    ## 동일한 입력 데이터 반환
    
    여기서 우리는 평문 비밀번호를 포함하는 `UserIn` 모델을 선언합니다:
    
    ```Python hl_lines="9  11"
    {!../../../docs_src/response_model/tutorial002.py!}
    ```
    
    그리고 이 모델을 사용하여 입력을 선언하고 같은 모델로 출력을 선언합니다:
    
    ```Python hl_lines="17-18"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  9. tests/test_response_model_data_filter_no_inheritance.py

        password: str
    
    
    class UserDB(BaseModel):
        email: str
        hashed_password: str
    
    
    class User(BaseModel):
        email: str
    
    
    class PetDB(BaseModel):
        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: User
    
    
    @app.post("/users/", response_model=User)
    async def create_user(user: UserCreate):
        return user
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  10. docs_src/bigger_applications/app_an_py39/routers/users.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 407 bytes
    - Viewed (0)
Back to top