- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 95 for Bohn (0.14 sec)
-
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 May 05 07:19:11 GMT 2024 - Last Modified: Mon Aug 14 09:49:57 GMT 2023 - 47.7K bytes - Viewed (0) -
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 May 05 07:19:11 GMT 2024 - Last Modified: Sat Sep 02 15:56:35 GMT 2023 - 498 bytes - Viewed (0) -
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 May 05 07:19:11 GMT 2024 - Last Modified: Sat Sep 02 15:56:35 GMT 2023 - 461 bytes - Viewed (0) -
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) -
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 May 05 07:19:11 GMT 2024 - Last Modified: Sat Sep 02 15:56:35 GMT 2023 - 492 bytes - Viewed (0) -
docs/pt/docs/tutorial/extra-models.md
Os modelos Pydantic possuem um método `.dict()` que retorna um `dict` com os dados do modelo. Então, se criarmos um objeto Pydantic `user_in` como: ```Python user_in = UserIn(username="john", password="secret", email="john******@****.***") ``` e depois chamarmos: ```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 - 7.8K bytes - Viewed (0) -
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) -
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) -
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) -
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)