πŸ’­ Models - Pydantic ━━━━━━━━━━━━━━━━━━━ !https://docs.pydantic.dev/latest/concepts/models/#rebuilding-model-schema Date: January 28, 2025 Image: Models Models Pydantic Docs Β· docs.pydantic.dev I came accross from_attributes today it allows creation of pydantic models from objects such as a sqlalchemy Base Model or while nesting pydantic models. I believe in the past I have ran into some inconsistencies with nesting pydantic models and I’ll bet one had from_attributes set and another did not. β”‚ Arbitrary class instancesΒΆ (Formerly known as β€œORM Mode”/from_orm). β”‚ β”‚ Pydantic models can also be created from arbitrary class instances by reading the instance > attributes corresponding to the model field names. One common application of this functionality is integration with object-relational mappings (ORMs). β”‚ β”‚ To do this, set the from_attributes config value to True (see the documentation on Configuration for more details). β”‚ β”‚ The example here uses SQLAlchemy, but the same approach should work for any ORM. NOTE β”‚ This post is a thought . It’s a short note that I make about someone else’s content online #thoughts