initial commit

This commit is contained in:
smueller
2026-07-03 11:35:25 +02:00
commit 146d398ecb
24 changed files with 1040 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from sqlalchemy.orm import Session
from app.models.system import AppConfig
def get_config(db: Session, key: str, default: str = "") -> str:
row = db.query(AppConfig).filter(AppConfig.key == key).first()
return row.value if row else default
def set_config(db: Session, key: str, value: str) -> None:
row = db.query(AppConfig).filter(AppConfig.key == key).first()
if row:
row.value = value
else:
db.add(AppConfig(key=key, value=value))
db.commit()