From 83eff3f2208cdeef3df2d3a9573b167bebba6aa2 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 10 Oct 2023 12:53:40 +0200 Subject: [PATCH] models:history - specify types of data Use JSON-serialisable types --- acacore/models/history.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/acacore/models/history.py b/acacore/models/history.py index 1b77eef..a8e7e80 100644 --- a/acacore/models/history.py +++ b/acacore/models/history.py @@ -1,5 +1,6 @@ from datetime import datetime -from typing import Any +from typing import Optional +from typing import Union from pydantic import UUID4 @@ -10,5 +11,5 @@ class HistoryEntry(ACABase): uuid: UUID4 time: datetime operation: str - data: Any | None = None - reason: str | None = None + data: Optional[Union[dict, list, str, int, float, bool, datetime]] = None + reason: Optional[str] = None