update
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user