def get_report_instance(self): """ :rtype: shuup.reports.reporter.base.ShuupReportBase """ from shuup.reports.report import get_report_class data = self.cleaned_data writer_name = data.pop("writer") report_class = get_report_class(data["report"]) report = report_class(writer_name=writer_name, **data) return report
def get_report_instance(self, request=None): """ :rtype: shuup.reports.reporter.base.ShuupReportBase """ from shuup.reports.report import get_report_class data = self.cleaned_data report_class = get_report_class(data["report"], request) writer_name = data.pop("writer") if request: data.update({"request": request}) report = report_class(writer_name=writer_name, **data) return report