🎨 add persistent property to trait

persistent drives if the trait should be integrated or not. Difference between Persistent trait and persistent attribute is that the trait drives the lifecycle of the representation but the attribute drives lifecycle of trait.
This commit is contained in:
Ondřej Samohel 2024-11-29 11:27:41 +01:00
parent 97fe8ac294
commit 32d82e47e6
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -10,6 +10,7 @@ from pydantic import (
AliasGenerator,
BaseModel,
ConfigDict,
Field,
)
if TYPE_CHECKING:
@ -32,6 +33,10 @@ class TraitBase(ABC, BaseModel):
)
)
persitent: bool = Field(
default=True, title="Persitent",
description="Whether the trait is persistent (integrated) or not.")
@property
@abstractmethod
def id(self) -> str: