Files
rose-ash/events
giles 57a31a3b83 Convert all 23 register_custom_layout calls to register_sx_layout across 6 services
Layout defcomps are now fully self-contained via IO-primitive auto-fetch
macros, eliminating Python layout functions that manually threaded context
values through SxExpr wrappers.

Services converted:
- Federation (1 layout): social
- Blog (7 layouts): blog, blog-settings, blog-cache, blog-snippets,
  blog-menu-items, blog-tag-groups, blog-tag-group-edit
- SX docs (2 layouts): sx, sx-section
- Cart (2 layouts): cart-page, cart-admin + orders/order-detail
- Events (9 layouts): calendar-admin, slots, slot, day-admin, entry,
  entry-admin, ticket-types, ticket-type, markets
- Market (2 layouts): market, market-admin

New IO primitives added to shared/sx/primitives_io.py:
- federation-actor-ctx, cart-page-ctx, request-view-args
- events-calendar-ctx, events-day-ctx, events-entry-ctx,
  events-slot-ctx, events-ticket-type-ctx
- market-header-ctx (pre-builds desktop/mobile nav as SxExpr)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 22:21:44 +00:00
..
2026-02-24 20:13:00 +00:00

Events App

Calendar and event booking service for the Rose Ash cooperative platform. Manages calendars, time slots, calendar entries (bookings), tickets, and ticket types.

Structure

app.py                  # Application factory (create_base_app + blueprints)
path_setup.py           # Adds project root + app dir to sys.path
entrypoint.sh           # Container entrypoint (Redis flush, start)
bp/
  calendars/            #   Calendar listing
  calendar/             #   Single calendar view and admin
  calendar_entries/     #   Calendar entries listing
  calendar_entry/       #   Single entry view and admin
  day/                  #   Day view and admin
  slots/                #   Slot listing
  slot/                 #   Single slot management
  ticket_types/         #   Ticket type listing
  ticket_type/          #   Single ticket type management
  tickets/              #   Ticket listing
  ticket_admin/         #   Ticket administration
  markets/              #   Page-scoped marketplace views
  payments/             #   Payment-related views
  fragments/            #   container-nav, container-cards fragments
models/                 # Re-export stubs (Calendar, CalendarEntry, Ticket, etc.)
services/               # register_domain_services() — wires calendar + market + cart
templates/              # Events-specific templates (override shared/)

Models

All events-domain models live in shared/models/:

Model Description
Calendar Container for entries, scoped to a page via container_type + container_id
CalendarEntry A bookable event/time slot with state (pending/ordered/provisional) and cost
CalendarSlot Recurring time bands (day-of-week + time range) within a calendar
TicketType Named ticket categories with price and count
Ticket Individual ticket with unique code, state, and order_id (plain integer, no FK)
CalendarEntryPost Junction linking entries to content via content_type + content_id

order_id on CalendarEntry and Ticket is a plain integer column — no FK constraint to the orders table. The cart app writes these values via service calls, not directly.

Cross-domain communication

  • services.market.* — marketplace queries for page views
  • services.cart.* — cart summary for context processor
  • services.federation.* — AP publishing for new entries

Fragments served

  • container-nav — calendar entries + links for blog sidebar
  • container-cards — event cards for blog listing pages