Replace sx_call() with render_to_sx() across all services

Python no longer generates s-expression strings. All SX rendering now
goes through render_to_sx() which builds AST from native Python values
and evaluates via async_eval_to_sx() — no SX string literals in Python.

- Add render_to_sx()/render_to_html() infrastructure in shared/sx/helpers.py
- Add (abort status msg) IO primitive in shared/sx/primitives_io.py
- Convert all 9 services: ~650 sx_call() invocations replaced
- Convert shared helpers (root_header_sx, full_page_sx, etc.) to async
- Fix likes service import bug (likes.models → models)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 00:08:33 +00:00
parent 0554f8a113
commit e085fe43b4
51 changed files with 1824 additions and 1742 deletions

View File

@@ -36,7 +36,7 @@ def register():
if not slot:
return await make_response("Not found", 404)
from sx.sx_components import render_slot_edit_form
return sx_response(render_slot_edit_form(slot, g.calendar))
return sx_response(await render_slot_edit_form(slot, g.calendar))
@bp.get("/view/")
@require_admin
@@ -45,7 +45,7 @@ def register():
if not slot:
return await make_response("Not found", 404)
from sx.sx_components import render_slot_main_panel
return sx_response(render_slot_main_panel(slot, g.calendar))
return sx_response(await render_slot_main_panel(slot, g.calendar))
@bp.delete("/")
@require_admin
@@ -54,7 +54,7 @@ def register():
await svc_delete_slot(g.s, slot_id)
slots = await svc_list_slots(g.s, g.calendar.id)
from sx.sx_components import render_slots_table
return sx_response(render_slots_table(slots, g.calendar))
return sx_response(await render_slots_table(slots, g.calendar))
@bp.put("/")
@require_admin
@@ -136,7 +136,7 @@ def register():
), 422
from sx.sx_components import render_slot_main_panel
return sx_response(render_slot_main_panel(slot, g.calendar, oob=True))
return sx_response(await render_slot_main_panel(slot, g.calendar, oob=True))