Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for user_dict (0.08 sec)

  1. docs/zh/docs/tutorial/extra-models.md

        password = user_dict["password"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
    )
    ```
    
    #### 用其它模型中的内容生成 Pydantic 模型
    
    上例中 ,从 `user_in.dict()` 中得到了 `user_dict`,下面的代码:
    
    ```Python
    user_dict = user_in.dict()
    UserInDB(**user_dict)
    ```
    
    等效于:
    
    ```Python
    UserInDB(**user_in.dict())
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. docs_src/security/tutorial003_an_py310.py

        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
        if not user_dict:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
        user = UserInDB(**user_dict)
        hashed_password = fake_hash_password(form_data.password)
        if not hashed_password == user.hashed_password:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/extra-models.md

    ⚖️ 🌅 ⚫️❔, ⚙️ `user_dict` 🔗, ⏮️ ⚫️❔ 🎚 ⚫️ 💪 ✔️ 🔮:
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        password = user_dict["password"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
    )
    ```
    
    #### Pydantic 🏷 ⚪️➡️ 🎚 ➕1️⃣
    
    🖼 🔛 👥 🤚 `user_dict` ⚪️➡️ `user_in.dict()`, 👉 📟:
    
    ```Python
    user_dict = user_in.dict()
    UserInDB(**user_dict)
    ```
    
    🔜 🌓:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  4. docs_src/security/tutorial003_an.py

        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
        if not user_dict:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
        user = UserInDB(**user_dict)
        hashed_password = fake_hash_password(form_data.password)
        if not hashed_password == user.hashed_password:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. docs_src/security/tutorial003_an_py39.py

        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
        if not user_dict:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
        user = UserInDB(**user_dict)
        hashed_password = fake_hash_password(form_data.password)
        if not hashed_password == user.hashed_password:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/extra-models.md

        'full_name': None,
    }
    ```
    
    #### Unwrapping a `dict`
    
    If we take a `dict` like `user_dict` and pass it to a function (or class) with `**user_dict`, Python will "unwrap" it. It will pass the keys and values of the `user_dict` directly as key-value arguments.
    
    So, continuing with the `user_dict` from above, writing:
    
    ```Python
    UserInDB(**user_dict)
    ```
    
    would result in something equivalent to:
    
    ```Python
    UserInDB(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/extra-models.md

    }
    ```
    
    #### Распаковка `dict`
    
    Если мы возьмём `dict` наподобие `user_dict` и передадим его в функцию (или класс), используя `**user_dict`, Python распакует его. Он передаст ключи и значения `user_dict` напрямую как аргументы типа ключ-значение.
    
    Поэтому, продолжая описанный выше пример с `user_dict`, написание такого кода:
    
    ```Python
    UserInDB(**user_dict)
    ```
    
    Будет работать так же, как примерно такой код:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/extra-models.md

    }
    ```
    
    #### Desembrulhando um `dict`
    
    Se tomarmos um `dict` como `user_dict` e passarmos para uma função (ou classe) com `**user_dict`, o Python irá "desembrulhá-lo". Ele passará as chaves e valores do `user_dict` diretamente como argumentos chave-valor.
    
    Então, continuando com o `user_dict` acima, escrevendo:
    
    ```Python
    UserInDB(**user_dict)
    ```
    
    Resultaria em algo equivalente a:
    
    ```Python
    UserInDB(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/extra-models.md

    }
    ```
    
    #### Ein `dict` entpacken
    
    Wenn wir ein `dict` wie `user_dict` nehmen, und es einer Funktion (oder Klassenmethode) mittels `**user_dict` übergeben, wird Python es „entpacken“. Es wird die Schlüssel und Werte von `user_dict` direkt als Schlüsselwort-Argumente übergeben.
    
    Wenn wir also das `user_dict` von oben nehmen und schreiben:
    
    ```Python
    UserInDB(**user_dict)
    ```
    
    dann ist das ungefähr äquivalent zu:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/extra-models.md

    もっと正確に言えば、`user_dict`を将来的にどんな内容であっても直接使用することになります:
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        password = user_dict["password"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
    )
    ```
    
    #### 別のモデルからつくるPydanticモデル
    
    上述の例では`user_in.dict()`から`user_dict`をこのコードのように取得していますが:
    
    ```Python
    user_dict = user_in.dict()
    UserInDB(**user_dict)
    ```
    
    これは以下と同等です:
    
    ```Python
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.7K bytes
    - Viewed (0)
Back to top