def get_attachments(self): if reporter.can_report('invoice'): report = reporter.get_report( 'invoice', context={ 'order': self.order, } ) return [(report.filename, report.data, report.mimetype)]
def order_confirmation(self, request, id): order = Order.objects.get(pk=id) invoice = reporter.get_report('order_confirmation', context={ 'order': order }) response = HttpResponse(content_type=invoice.mimetype) response.write(invoice.data) return response
def get_attachments(self): if reporter.can_report('order_confirmation'): report = reporter.get_report( 'order_confirmation', context={ 'order': self.order } ) return [(report.filename, report.data, report.mimetype)]