Add prototype doc

This commit is contained in:
Edward Brown 2026-04-29 10:47:13 +01:00
parent 8dc96d708d
commit f42becceb0
24 changed files with 657 additions and 51 deletions

View file

@ -6,9 +6,20 @@ from typing import Any
@dataclass(kw_only=True)
class Base:
"""
Base class for haco objects. Provides model dumping functionality.
"""
DATA = dict()
def model_dump(self) -> dict[str, Any]:
"""
Dump the object to a dictionary, excluding fields marked with `exclude=True` in metadata.
"""
data = {} | self.DATA
for fld in fields(self):
meta = fld.metadata