forked from uncloud/uncloud
++bridge update
This commit is contained in:
parent
6b9b15e663
commit
a920887100
16 changed files with 275 additions and 138 deletions
|
|
@ -47,9 +47,13 @@ class BillAdmin(admin.ModelAdmin):
|
|||
raise self._get_404_exception(object_id)
|
||||
|
||||
output_file = NamedTemporaryFile()
|
||||
bill_html = render_to_string("bill.html.j2", {'bill': bill,
|
||||
'bill_records': bill.billrecord_set.all()
|
||||
})
|
||||
bill_html = render_to_string(
|
||||
"uncloud_pay/bill.html.j2",
|
||||
{
|
||||
'bill': bill,
|
||||
'bill_records': bill.billrecord_set.all()
|
||||
}
|
||||
)
|
||||
|
||||
bytestring_to_pdf(bill_html.encode('utf-8'), output_file)
|
||||
response = FileResponse(output_file, content_type="application/pdf")
|
||||
|
|
@ -63,7 +67,7 @@ class BillAdmin(admin.ModelAdmin):
|
|||
if bill is None:
|
||||
raise self._get_404_exception(object_id)
|
||||
|
||||
return render(request, 'bill.html.j2',
|
||||
return render(request, 'uncloud_pay/bill.html.j2',
|
||||
{'bill': bill,
|
||||
'bill_records': bill.billrecord_set.all()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue