mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Generate PDFs from Power Test Records (#594)
* Add new block to base_print.xml for additional styles from downstream templates * Fix page totals on exports by adding <namedString> element * Add new print template for power test records * Add a generated name property to power tests to allow for export * Add new routes for print export for power tests * Add print button to power test records view page * Address linting errors
This commit is contained in:
@@ -232,6 +232,16 @@ class RAPrint(PrintView):
|
||||
return context
|
||||
|
||||
|
||||
class PowerPrint(PrintView):
|
||||
model = models.PowerTestRecord
|
||||
template_name = 'hs/power_print.xml'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['filename'] = f"PowerTestRecord_for_{context['object'].event.display_id}.pdf"
|
||||
return context
|
||||
|
||||
|
||||
class EventCheckIn(generic.CreateView, ModalURLMixin):
|
||||
model = models.EventCheckIn
|
||||
template_name = 'hs/eventcheckin_form.html'
|
||||
|
||||
Reference in New Issue
Block a user