Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for read_with_orm_mode (0.22 sec)

  1. tests/test_read_with_orm_mode.py

        class Person(PersonBase):
            @property
            def full_name(self) -> str:
                return f"{self.name} {self.lastname}"
    
            class Config:
                orm_mode = True
                read_with_orm_mode = True
    
        class PersonCreate(PersonBase):
            pass
    
        class PersonRead(PersonBase):
            full_name: str
    
            class Config:
                orm_mode = True
    
        app = FastAPI()
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  2. fastapi/routing.py

        *,
        exclude_unset: bool,
        exclude_defaults: bool = False,
        exclude_none: bool = False,
    ) -> Any:
        if isinstance(res, BaseModel):
            read_with_orm_mode = getattr(_get_model_config(res), "read_with_orm_mode", None)
            if read_with_orm_mode:
                # Let from_orm extract the data from this model instead of converting
                # it now to a dict.
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 170.1K bytes
    - Viewed (0)
  3. docs/en/docs/release-notes.md

    * 🔧 Add new Sponsor Calmcode.io. PR [#3777](https://github.com/tiangolo/fastapi/pull/3777) by [@tiangolo](https://github.com/tiangolo).
    
    ## 0.68.1
    
    * ✨ Add support for `read_with_orm_mode`, to support [SQLModel](https://sqlmodel.tiangolo.com/) relationship attributes. PR [#3757](https://github.com/tiangolo/fastapi/pull/3757) by [@tiangolo](https://github.com/tiangolo).
    
    ### Translations
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 14 15:07:37 UTC 2024
    - 395.4K bytes
    - Viewed (0)
Back to top