Report
CQRS report configuration.
Defines reports that support zero-cliff scalability fromstartup (Code Reports) to enterprise (Analytics with OLAP).
Attributes: name: Unique report identifier report_type: Report execution mode (Code Report or Analytics Report) data_source: Data source adapter (SQL, Elastic, ClickHouse) query: Report query (SQL file path, SQL query, or Elastic DSL) enabled: Whether the report is activeSource: report.py
Fields
Section titled “Fields”| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| name | str | ✓ | Unique report identifier | minLen: 1, maxLen: 255 |
| report_type | str | ✓ | Report execution mode: ‘Code Report’ (indie) or ‘Analytics Report’ (enterprise) | - |
| data_source | None | Data source adapter: SQL, Elastic, ClickHouse (for Analytics Reports) | - | |
| query | None | Report query: SQL file path, SQL query, or Elastic DSL JSON | - | |
| enabled | bool | Whether the report is active | - | |
| parameters_schema | None | ( |
"Parameter definitions keyed by field name. " "Each value is a dict with keys: type (link|date|date_range|text|select), " "resource (for link fields), label (display name). " "Example: {'company': {'type': 'link', 'resource': 'Company', 'label': 'Company'}}") | - |Permissions
Section titled “Permissions”| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| Admin | ✓ | ✓ | ✓ | ✓ |
| Employee | ✓ | |||
| Manager | ✓ | ✓ | ✓ |
Configuration
Section titled “Configuration”| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Section titled “Controller”Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting