JourneyJoker/payment/pdfviews.py

9 lines
322 B
Python
Raw Normal View History

from pdf.views import PDFView
class InvoicePDFView(PDFView):
template_name = "payment/invoice.html"
def get_context_data(self, **kwargs):
kwargs.setdefault('type', "Rechnung")
kwargs.setdefault('title', f'{kwargs["type"]} #{kwargs["object"].id}')
return super().get_context_data(**kwargs)