I have three Pydantic classes like so:
class Meta(BaseModel):
"""Meta data attached to parent objects"""
description: str = Field(description="description of the parent object")
type: str = Field(description="type of the parent object")
class Goal(BaseModel):
"""Customer goals"""
_id: str
meta: Meta_v2
class Insurance(BaseModel):
"""Customer insurance"""
_id: str
meta: Meta_v2
When I create an Insurance class, I want to automatically create a nested instance of Meta with:
description: "A customer insurance policy"
type: "insurance"
But when I create a Goal class, I want to automatically create a nested instance of Meta with:
description: "A customer goal"
type: "goal"
How do I do this pls?