rattail.reporting.handlers
¶
Report Handlers
- class rattail.reporting.handlers.ReportHandler(config=None, **kwargs)[source]¶
Base class for all report handlers. Also provides default implementation, which is assumed to be sufficient for most needs.
- email_output(report, output, mailkey, fallback_mailkey='common_report', extra_data={}, **kwargs)[source]¶
Send an email (using the given
mailkey
) with the report output as an attachment.- Parameters:
report¶ – The relevant
Report
instance.output¶ – The relevant
ReportOutput
instance.mailkey¶ – Config key which identifies the type of email to be sent.
fallback_mailkey¶ – Config key to be used as fallback, should the
mailkey
not point to a valid email config.extra_data¶ – Additional context data to be passed along to the email template.
kwargs¶ – Additional kwargs to be passed directly to
send_email()
.
- generate_output(session, report, params, user, progress=None, **kwargs)[source]¶
Generate and return output for the given report and params.
- rattail.reporting.handlers.get_report_handler(config, **kwargs)[source]¶
Create and return the configured
ReportHandler
instance.