fix: default values in subordinate entities based on static_filtering, add: button visibility callbacks in entities' forms

This commit is contained in:
Alexander Kalinovsky
2025-01-22 20:04:32 +01:00
parent 9dd0708a5b
commit b40e588379
7 changed files with 129 additions and 77 deletions

View File

@@ -57,12 +57,10 @@ async def deserialize[T](session: AsyncSession, type_: type[T], value: str = Non
elif type_ is datetime:
if is_optional and not value:
return None
if value[-3] == ":":
return datetime.strptime(value, "%Y-%m-%d %H:%M:%S")
elif value[-3] == "-":
if value[-3] == "-":
return datetime.strptime(value, "%Y-%m-%d %H-%M")
else:
raise ValueError("Invalid datetime format")
return datetime.fromisoformat(value)
elif type_ is bool:
return value == "True"
elif type_ is Decimal: