Export action
Introduction
Section titled “Introduction”ExportAction is the header button that takes the current list of records (search, filters, and all) and turns it into a file. The default runner serialises CSV or JSON in the request and the browser downloads it from the orbit-export-ready event.
from almasix.orbit.actions import ExportAction
table.header_actions([ ExportAction.make() .formats(["csv", "json"]) .columns(["title", "status", "amount"]) .column_map({"title": "Title", "status": "Status"}) .filename("posts") .chunk_size(500) .max_rows(50_000),])mountAction("export", payload={"format": "csv"}) returns {filename, format, rows, content, mime}.


Configuration
Section titled “Configuration”| Method | Role |
|---|---|
.formats |
Allowed formats (csv, json) |
.columns |
Attributes to include (all keys if omitted) |
.column_map |
Attribute → header label |
.filename |
Base name (string or callable) |
.chunk_size / .max_rows |
Limits for a custom exporter |
.exporter |
Optional callable that returns text, a dict, or an ExportReport |
Custom exporter
Section titled “Custom exporter”from almasix.orbit.actions import Exporter, ExportAction
class PostExporter(Exporter): def __call__(self, records=None, **kwargs): return {"content": render_xlsx(records), "filename": "posts.xlsx", "mime": "application/vnd.ms-excel"}
ExportAction.make().exporter(PostExporter()).formats(["xlsx"]).filename() accepts a callable:
from datetime import dateExportAction.make().filename(lambda **_: f"posts-{date.today().isoformat()}")Queueing
Section titled “Queueing”Same runner as import — see Import action. set_job_runner(...) replaces both.
Header placement
Section titled “Header placement”from almasix.orbit.actions import ExportAction, ImportAction
table.header_actions([ ImportAction.make().column_map({"Title": "title"}), ExportAction.make().filename("posts"),])