Ignore:
Timestamp:
4 Nov 2013, 16:22:35 (11 years ago)
Author:
Henrik Bettermann
Message:

Add pdf registration form.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py

    r10692 r10695  
    206206            omit_fields=self.omit_fields
    207207            )
     208
     209class ExportPDFRegistrationSlipPage(grok.View):
     210    """Deliver a PDF slip of the context.
     211    """
     212    grok.context(ICustomStudent)
     213    grok.name('registration_form.pdf')
     214    grok.require('waeup.viewStudent')
     215    prefix = 'form'
     216    omit_fields = (
     217        'suspended', 'phone',
     218        'adm_code', 'suspended_comment', 'email', 'sex',
     219        'current_mode', 'matric_number')
     220    title = ''
     221    label = 'Registration Form'
     222
     223    form_fields = grok.AutoFields(ICustomStudent).select(
     224        'marit_stat', 'lga', 'nationality',
     225        'perm_address',)
     226
     227    def render(self):
     228        studentview = StudentBasePDFFormPage(self.context.student,
     229            self.request, self.omit_fields)
     230        students_utils = getUtility(IStudentsUtils)
     231        return students_utils.renderPDF(
     232            self, 'registration_form.pdf',
     233            self.context.student, studentview, signatures=([_('Bursar')],),
     234            omit_fields=self.omit_fields)
Note: See TracChangeset for help on using the changeset viewer.