Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 124 for Kohn (0.21 sec)

  1. docs_src/python_types/tutorial001.py

    def get_full_name(first_name, last_name):
        full_name = first_name.title() + " " + last_name.title()
        return full_name
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 162 bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/extra-models.md

    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    就能以如下方式调用:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    现在,变量 `user_dict`中的就是包含数据的**字典**(变量 `user_dict` 是字典,不是 Pydantic 模型对象)。
    
    以如下方式调用:
    
    ```Python
    print(user_dict)
    ```
    
    输出的就是 Python **字典**:
    
    ```Python
    {
        'username': 'john',
        'password': 'secret',
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 01:15:53 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  3. docs_src/security/tutorial002_an_py310.py

        email: str | None = None
        full_name: str | None = None
        disabled: bool | None = None
    
    
    def fake_decode_token(token):
        return User(
            username=token + "fakedecoded", email="john@example.com", full_name="John Doe"
        )
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
        return user
    
    
    @app.get("/users/me")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 761 bytes
    - Viewed (0)
  4. docs_src/security/tutorial002_an.py

        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    def fake_decode_token(token):
        return User(
            username=token + "fakedecoded", email="john@example.com", full_name="John Doe"
        )
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
        return user
    
    
    @app.get("/users/me")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 815 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial006_an.py

    from docs_src.security.tutorial006_an import app
    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  6. docs/de/docs/tutorial/extra-models.md

    Pydantic-Modelle haben eine `.dict()`-Methode, die ein `dict` mit den Daten des Modells zurückgibt.
    
    Wenn wir also ein Pydantic-Objekt `user_in` erstellen, etwa so:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    und wir rufen seine `.dict()`-Methode auf:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/extra-models.md

    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    & ⤴️ 👥 🤙:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    👥 🔜 ✔️ `dict` ⏮️ 💽 🔢 `user_dict` (⚫️ `dict` ↩️ Pydantic 🏷 🎚).
    
    & 🚥 👥 🤙:
    
    ```Python
    print(user_dict)
    ```
    
    👥 🔜 🤚 🐍 `dict` ⏮️:
    
    ```Python
    {
        'username': 'john',
        'password': 'secret',
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/extra-models.md

    У Pydantic-моделей есть метод `.dict()`, который возвращает `dict` с данными модели.
    
    Поэтому, если мы создадим Pydantic-объект `user_in` таким способом:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    и затем вызовем:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    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)
  9. docs/ja/docs/tutorial/extra-models.md

    ```Python
    user_in = UserIn(username="john", password="secret", email="john******@****.***")
    ```
    
    そして呼び出すと:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    これで変数`user_dict`のデータを持つ`dict`ができました。(これはPydanticモデルのオブジェクトの代わりに`dict`です)。
    
    そして呼び出すと:
    
    ```Python
    print(user_dict)
    ```
    
    以下のようなPythonの`dict`を得ることができます:
    
    ```Python
    {
        'username': 'john',
        'password': 'secret',
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jan 15 15:36:32 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  10. tests/test_security_http_basic_realm_description.py

    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
Back to top