Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for from_attributes (0.1 sec)

  1. tests/test_read_with_orm_mode.py

            def full_name(self) -> str:
                return f"{self.name} {self.lastname}"
    
            model_config = ConfigDict(from_attributes=True)
    
        class PersonCreate(PersonBase):
            pass
    
        class PersonRead(PersonBase):
            full_name: str
    
            model_config = {"from_attributes": True}
    
        app = FastAPI()
    
        @app.post("/people/", response_model=PersonRead)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  2. fastapi/_compat/v2.py

            *,
            loc: tuple[Union[int, str], ...] = (),
        ) -> tuple[Any, Union[list[dict[str, Any]], None]]:
            try:
                return (
                    self._type_adapter.validate_python(value, from_attributes=True),
                    None,
                )
            except ValidationError as exc:
                return None, _regenerate_error_with_loc(
                    errors=exc.errors(include_url=False), loc_prefix=loc
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
Back to top