- Sort Score
- Result 10 results
- Languages All
Results 301 - 310 of 375 for BaseModel (0.1 sec)
-
scripts/label_approved.py
import logging from typing import Literal from github import Github from github.PullRequestReview import PullRequestReview from pydantic import BaseModel, SecretStr from pydantic_settings import BaseSettings class LabelSettings(BaseModel): await_label: str | None = None number: int default_config = {"approved-2": LabelSettings(await_label="awaiting-review", number=2)} class Settings(BaseSettings):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 13:58:30 UTC 2024 - 2.2K bytes - Viewed (0) -
tests/test_router_events.py
from typing import AsyncGenerator, Dict, Union import pytest from fastapi import APIRouter, FastAPI, Request from fastapi.testclient import TestClient from pydantic import BaseModel class State(BaseModel): app_startup: bool = False app_shutdown: bool = False router_startup: bool = False router_shutdown: bool = False sub_router_startup: bool = False
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 19:09:52 UTC 2024 - 7.3K bytes - Viewed (0) -
docs/ru/docs/tutorial/body.md
/// ## Импортирование `BaseModel` из Pydantic Первое, что вам необходимо сделать, это импортировать `BaseModel` из пакета `pydantic`: ```Python hl_lines="4" {!../../docs_src/body/tutorial001.py!} ``` ## Создание вашей собственной модели После этого вы описываете вашу модель данных как класс, наследующий от `BaseModel`. Используйте аннотации типов Python для всех атрибутов:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.9K bytes - Viewed (0) -
tests/test_openapi_separate_input_output_schemas.py
from fastapi.testclient import TestClient from pydantic import BaseModel from .utils import PYDANTIC_V2, needs_pydanticv2 class SubItem(BaseModel): subname: str sub_description: Optional[str] = None tags: List[str] = [] if PYDANTIC_V2: model_config = {"json_schema_serialization_defaults_required": True} class Item(BaseModel): name: str description: Optional[str] = None
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 09:44:57 UTC 2024 - 19.7K bytes - Viewed (0) -
tests/test_response_model_sub_types.py
from typing import List from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel class Model(BaseModel): name: str app = FastAPI() @app.get("/valid1", responses={"500": {"model": int}}) def valid1(): pass @app.get("/valid2", responses={"500": {"model": List[int]}}) def valid2(): pass @app.get("/valid3", responses={"500": {"model": Model}})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.3K bytes - Viewed (0) -
docs/de/docs/tutorial/body.md
/// ## Importieren Sie Pydantics `BaseModel` Zuerst müssen Sie `BaseModel` von `pydantic` importieren: //// tab | Python 3.10+ ```Python hl_lines="2" {!> ../../docs_src/body/tutorial001_py310.py!} ``` //// //// tab | Python 3.8+
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8K bytes - Viewed (0) -
docs/zh/docs/tutorial/body.md
/// ## 导入 Pydantic 的 `BaseModel` 从 `pydantic` 中导入 `BaseModel`: //// tab | Python 3.10+ ```Python hl_lines="2" {!> ../../docs_src/body/tutorial001_py310.py!} ``` //// //// tab | Python 3.8+ ```Python hl_lines="4" {!> ../../docs_src/body/tutorial001.py!} ``` //// ## 创建数据模型 把数据模型声明为继承 `BaseModel` 的类。 使用 Python 标准类型声明所有属性:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.4K bytes - Viewed (0) -
docs/pt/docs/tutorial/body.md
/// ## Importe o `BaseModel` do Pydantic Primeiro, você precisa importar `BaseModel` do `pydantic`: ```Python hl_lines="4" {!../../docs_src/body/tutorial001.py!} ``` ## Crie seu modelo de dados Então você declara seu modelo de dados como uma classe que herda `BaseModel`. Utilize os tipos Python padrão para todos os atributos: ```Python hl_lines="7-11"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.1K bytes - Viewed (0) -
docs/en/docs/tutorial/body.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 16:58:19 UTC 2024 - 6.6K bytes - Viewed (0) -
docs/fr/docs/tutorial/body.md
/// ## Importez le `BaseModel` de Pydantic Commencez par importer la classe `BaseModel` du module `pydantic` : {* ../../docs_src/body/tutorial001.py hl[4] *} ## Créez votre modèle de données Déclarez ensuite votre modèle de données en tant que classe qui hérite de `BaseModel`. Utilisez les types Python standard pour tous les attributs :
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 17:34:41 UTC 2024 - 7.6K bytes - Viewed (0)