Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for confirm (0.27 sec)

  1. tests/test_compat.py

            class_validators={},
            model_config=BaseConfig,
        )
        assert not is_pv1_scalar_field(field)
    
    
    @needs_pydanticv2
    def test_get_model_config():
        # For coverage in Pydantic v2
        class Foo(BaseModel):
            model_config = ConfigDict(from_attributes=True)
    
        foo = Foo()
        config = _get_model_config(foo)
        assert config == {"from_attributes": True}
    
    
    def test_complex():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  2. docs_src/settings/app03_an_py39/main.py

    from functools import lru_cache
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 462 bytes
    - Viewed (0)
  3. docs_src/sql_databases/sql_app_py310/schemas.py

        pass
    
    
    class Item(ItemBase):
        id: int
        owner_id: int
    
        class Config:
            orm_mode = True
    
    
    class UserBase(BaseModel):
        email: str
    
    
    class UserCreate(UserBase):
        password: str
    
    
    class User(UserBase):
        id: int
        is_active: bool
        items: list[Item] = []
    
        class Config:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 464 bytes
    - Viewed (0)
  4. fastapi/utils.py

                {
                    "type_": type_,
                    "class_validators": class_validators,
                    "default": default,
                    "required": required,
                    "model_config": model_config,
                    "alias": alias,
                }
            )
        try:
            return ModelField(**kwargs)  # type: ignore[arg-type]
        except (RuntimeError, PydanticSchemaGenerationError):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  5. tests/test_additional_properties_bool.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel, ConfigDict
    
    
    class FooBaseModel(BaseModel):
        if PYDANTIC_V2:
            model_config = ConfigDict(extra="forbid")
        else:
    
            class Config:
                extra = "forbid"
    
    
    class Foo(FooBaseModel):
        pass
    
    
    app = FastAPI()
    
    
    @app.post("/")
    async def post(
        foo: Union[Foo, None] = None,
    ):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  6. docs_src/schema_extra_example/tutorial001_py310_pv1.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
        class Config:
            schema_extra = {
                "examples": [
                    {
                        "name": "Foo",
                        "description": "A very nice Item",
                        "price": 35.4,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 631 bytes
    - Viewed (0)
  7. tests/test_response_by_alias.py

        name: str
    
        if PYDANTIC_V2:
            model_config = ConfigDict(
                json_schema_extra={
                    "description": (
                        "response_model_by_alias=False is basically a quick hack, to support "
                        "proper OpenAPI use another model with the correct field names"
                    )
                }
            )
        else:
    
            class Config:
                schema_extra = {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  8. ci/official/containers/linux_arm64/devel.usertools/squash_testlogs.py

      source_file = p.getparent().getparent().get("source_file", "")
      p.text += f"\nNOTE: From {source_file}"
      if "bazel_pip" in source_file:
        p.text += (
            "\nNOTE: This is a --config=pip test. Remove 'bazel_pip' to find"
            " the file."
        )
      n_failures = seen[key]
      p.text += f"\nNOTE: Number of failures for this test: {seen[key]}."
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Sep 18 19:00:37 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  9. docs_src/settings/app02_an_py39/config.py

    Sebastián Ramírez <******@****.***> 1688749933 +0200
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 159 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py

            '"dom_id": "#swagger-ui"' in response.text
        ), "default configs should be preserved"
        assert "presets: [" in response.text, "default configs should be preserved"
        assert (
            "SwaggerUIBundle.presets.apis," in response.text
        ), "default configs should be preserved"
        assert (
            "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text
        ), "default configs should be preserved"
        assert (
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.4K bytes
    - Viewed (0)
Back to top