(self)
return report
Creates data source and report config.

        :raises BadSpecError if validation fails when building data source, or report is invalid
Creates data source and report config.
Creates data source and report config .
def create_report(self):
        """
        Creates data source and report config.

        :raises BadSpecError if validation fails when building data source, or report is invalid
        """
        if self.ds_builder.uses_managed_data_source:
            data_source_config_id = self._build_data_source()
        else:
            data_source_config_id = self.ds_builder.data_source_id
        report = self.ds_builder.report_config_class(
            domain=self.domain,
            config_id=data_source_config_id,
            title=self.cleaned_data['report_title'] or self.report_name,
            aggregation_columns=self._report_aggregation_cols,
            columns=self._get_report_columns(),
            filters=self._report_filters,
            configured_charts=self._report_charts,
            description=self.cleaned_data['report_description'],
            report_meta=ReportMeta(
                created_by_builder=True,
                report_builder_version="2.0",
                builder_report_type=self.report_type,
                builder_source_type=self.source_type,
            )
        )
        report.validate()

        DomainAuditRecordEntry.update_calculations(self.domain, 'cp_n_reports_created')

        report.save()
        return report
def create_report ( self ) : if self . ds_builder . uses_managed_data_source : data_source_config_id = self . _build_data_source ( ) else : data_source_config_id = self . ds_builder . data_source_id report = self . ds_builder . report_config_class ( domain = self . domain , config_id = data_source_config_id , title = self . cleaned_data [ 'report_title' ] or self . report_name , aggregation_columns = self . _report_aggregation_cols , columns = self . _get_report_columns ( ) , filters = self . _report_filters , configured_charts = self . _report_charts , description = self . cleaned_data [ 'report_description' ] , report_meta = ReportMeta ( created_by_builder = True , report_builder_version = "2.0" , builder_report_type = self . report_type , builder_source_type = self . source_type , ) ) report . validate ( ) DomainAuditRecordEntry . update_calculations ( self . domain , 'cp_n_reports_created' ) report . save ( ) return report