- Sort Score
- Num 10 results
- Language All
Results 311 - 320 of 714 for pydantic (0.08 seconds)
-
docs_src/cookie_param_models/tutorial002_py310.py
from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): model_config = {"extra": "forbid"} session_id: str fatebook_tracker: str | None = None googall_tracker: str | None = None @app.get("/items/") async def read_items(cookies: Cookies = Cookie()):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 343 bytes - Click Count (0) -
docs_src/cookie_param_models/tutorial001_an_py310.py
from typing import Annotated from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): session_id: str fatebook_tracker: str | None = None googall_tracker: str | None = None @app.get("/items/") async def read_items(cookies: Annotated[Cookies, Cookie()]):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 343 bytes - Click Count (0) -
docs_src/response_model/tutorial006_py310.py
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float = 10.5 items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2}, "baz": { "name": "Baz", "description": "There goes my baz",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 816 bytes - Click Count (0) -
tests/test_compat.py
from fastapi._compat import ( Undefined, is_uploadfile_sequence_annotation, ) from fastapi._compat.shared import is_bytes_sequence_annotation from fastapi.testclient import TestClient from pydantic import BaseModel, ConfigDict from pydantic.fields import FieldInfo from .utils import needs_py310 def test_model_field_default_required(): from fastapi._compat import v2 # For coverage
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 4.2K bytes - Click Count (0) -
docs_src/cookie_param_models/tutorial001_an_py39.py
from typing import Annotated, Union from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): session_id: str fatebook_tracker: Union[str, None] = None googall_tracker: Union[str, None] = None @app.get("/items/") async def read_items(cookies: Annotated[Cookies, Cookie()]):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 362 bytes - Click Count (0) -
docs_src/extra_models/tutorial004_py39.py
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str items = [ {"name": "Foo", "description": "There comes my hero"}, {"name": "Red", "description": "It's my aeroplane"}, ] @app.get("/items/", response_model=list[Item]) async def read_items():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 356 bytes - Click Count (0) -
docs/ru/docs/tutorial/query-params-str-validations.md
Теперь вы знаете, что когда они понадобятся, вы сможете использовать их в **FastAPI**. ### `regex` из Pydantic v1 вместо `pattern` { #pydantic-v1-regex-instead-of-pattern } До Pydantic версии 2 и до FastAPI 0.100.0 этот параметр назывался `regex`, а не `pattern`, но сейчас он устарел. Вы всё ещё можете встретить такой код: //// tab | Pydantic v1 {* ../../docs_src/query_params_str_validations/tutorial004_regex_an_py310.py hl[11] *}Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 26.2K bytes - Click Count (0) -
docs/es/docs/advanced/openapi-callbacks.md
{* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *} /// tip | Consejo El parámetro de query `callback_url` utiliza un tipo <a href="https://docs.pydantic.dev/latest/api/networks/" class="external-link" target="_blank">Url</a> de Pydantic. /// Lo único nuevo es `callbacks=invoices_callback_router.routes` como un argumento para el *decorador de path operation*. Veremos qué es eso a continuación.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 16 16:33:45 GMT 2025 - 8.3K bytes - Click Count (0) -
docs/zh/docs/tutorial/sql-databases.md
### 创建模型 导入 `SQLModel` 并创建一个数据库模型: {* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[1:11] hl[7:11] *} `Hero` 类与 Pydantic 模型非常相似(实际上,从底层来看,它确实*就是一个 Pydantic 模型*)。 有一些区别: * `table=True` 会告诉 SQLModel 这是一个*表模型*,它应该表示 SQL 数据库中的一个*表*,而不仅仅是一个*数据模型*(就像其他常规的 Pydantic 类一样)。 * `Field(primary_key=True)` 会告诉 SQLModel `id` 是 SQL 数据库中的**主键**(您可以在 SQLModel 文档中了解更多关于 SQL 主键的信息)。Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sun Dec 15 17:11:14 GMT 2024 - 14.9K bytes - Click Count (0) -
docs_src/path_operation_configuration/tutorial005_py39.py
from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: set[str] = set() @app.post( "/items/", response_model=Item, summary="Create an item", response_description="The created item", )
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 736 bytes - Click Count (0)