catalogue operations, db migr and so on.

pre release version.
This commit is contained in:
2026-03-11 20:26:38 +07:00
parent 1af0cf1826
commit 7f4f8a883d
17 changed files with 284 additions and 63 deletions

11
misc/mapper.py Normal file
View File

@@ -0,0 +1,11 @@
def parse_cat_id(value: str) -> int | None | bool:
if value == "root":
return None
if str(value).isdigit():
return int(value)
raise Exception("Invalid Category Id.")
def serialize_cat_id(cat_id: int | None) -> str:
return "root" if cat_id is None else str(cat_id)