Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 93 for Sohn (0.17 sec)

  1. tests/test_response_model_as_return_annotation.py

        return User(name="John", surname="Doe")
    
    
    @app.get("/no_response_model-no_annotation-return_dict")
    def no_response_model_no_annotation_return_dict():
        return {"name": "John", "surname": "Doe"}
    
    
    @app.get("/response_model-no_annotation-return_same_model", response_model=User)
    def response_model_no_annotation_return_same_model():
        return User(name="John", surname="Doe")
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Aug 14 09:49:57 GMT 2023
    - 47.7K bytes
    - Viewed (0)
  2. docs_src/python_types/tutorial011.py

    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: Union[datetime, None] = None
        friends: List[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    # > User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
    print(user.id)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Sep 02 15:56:35 GMT 2023
    - 498 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial006_an_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_security_http_basic(client: TestClient):
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    @needs_py39
    def test_security_http_basic_no_credentials(client: TestClient):
        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.5K bytes
    - Viewed (0)
  4. docs_src/python_types/tutorial011_py310.py

    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: datetime | None = None
        friends: list[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    # > User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
    print(user.id)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Sep 02 15:56:35 GMT 2023
    - 461 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial011_py39.py

    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: Union[datetime, None] = None
        friends: list[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    # > User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
    print(user.id)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Sep 02 15:56:35 GMT 2023
    - 492 bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Apr 01 01:15:53 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  7. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  8. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 15 15:36:32 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  9. 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)
  10. tests/test_tutorial/test_security/test_tutorial006.py

    from docs_src.security.tutorial006 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)
Back to top