feat(anhaenge): attachment_count im Termin-JSON
Die Terminliste traegt nur die Anzahl, nicht die Anhaenge selbst. Der Merge-Read laeuft pro Termin durch eine Schleife -- eine Lazy-Relationship waere dort eine Abfrage je Termin ueber eine ganze Monatsansicht, und ein wiederkehrender Termin wuerde dieselbe Liste an jeder Instanz wiederholen. Stattdessen je Kalender eine gruppierte Abfrage; die Liste holen die Clients beim Oeffnen der Detailansicht. mask_busy_event setzt die Zahl ausdruecklich auf 0: dass ein als "Beschaeftigt" maskierter Termin drei Dateien haette, ist auch eine Information. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0e8a1a6a3d
commit
b885e731ee
@@ -110,7 +110,11 @@ def _cal_dict(cal: models.LocalCalendar, *, owned: bool = True,
|
||||
|
||||
|
||||
def _event_dict(ev: models.LocalEvent, cal: models.LocalCalendar, db: Session) -> dict:
|
||||
return build_local_event_dict(ev, cal, creator=resolve_creator(ev))
|
||||
counts = attachments_store.counts_for_events(db, [ev.id])
|
||||
return build_local_event_dict(
|
||||
ev, cal, creator=resolve_creator(ev),
|
||||
attachment_count=counts.get(ev.id, 0),
|
||||
)
|
||||
|
||||
|
||||
# ── Calendar CRUD ─────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user