This commit is contained in:
team3
2026-06-24 09:38:20 +02:00
parent d389584b58
commit e985f07696
2 changed files with 25 additions and 10 deletions

View File

@@ -557,6 +557,17 @@ async def count_relevant_subs(topic: str, baustein: str) -> int:
return (await cursor.fetchone())[0]
async def subs_count_roh(topic: str) -> dict[str, int]:
"""Relevante Konsens-Subbausteine je ROHEM Baustein-Titel (= Guide-Section-Titel) eines Themas."""
db = await get_db()
cursor = await db.execute(
"SELECT baustein, COUNT(*) FROM subbausteine WHERE topic = ? "
"AND status = 'konsens' AND relevanz != 'rand' GROUP BY baustein",
(topic,),
)
return {b: n for b, n in await cursor.fetchall()}
async def subs_count_alle() -> dict[tuple[str, str], int]:
"""Relevante Konsens-Subbausteine je (topic, baustein_norm) — für die Stufen-Ableitung."""
db = await get_db()