Changeset 9374


Ignore:
Timestamp:
21 Oct 2012, 20:28:28 (12 years ago)
Author:
Henrik Bettermann
Message:

Start customization of base data fields on pdf slips.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/frontpage.html

    r8367 r9374  
    1818<a href="https://waeup.org/">West African eUniversity Project (WAeUP)</a>.
    1919It is a powerful and comprehensive Student Management System.
    20 The software is written in Python and build upon the Open Source
     20The software is written in Python and built upon the Open Source
    2121<a href="http://grok.zope.org/">Grok Web Framework</a>.
    2222</p>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9338 r9374  
    371371    """ Page to display student base data in pdf files.
    372372    """
    373     form_fields = grok.AutoFields(IStudentBase).omit(
    374         'password', 'suspended', 'phone', 'adm_code', 'sex')
     373
     374    def __init__(self, context, request, omit_fields):
     375        self.omit_fields = omit_fields
     376        super(StudentBasePDFFormPage, self).__init__(context, request)
     377
     378    @property
     379    def form_fields(self):
     380        form_fields = grok.AutoFields(IStudentBase)
     381        for field in self.omit_fields:
     382            form_fields = form_fields.omit(field)
     383        return form_fields
    375384
    376385class ContactStudentForm(ContactAdminForm):
     
    622631    def render(self):
    623632        studentview = StudentBasePDFFormPage(self.context.student,
    624             self.request)
     633            self.request, ('password', 'suspended', 'phone', 'adm_code', 'sex'))
    625634        students_utils = getUtility(IStudentsUtils)
    626635        return students_utils.renderPDF(
     
    10151024        Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language)
    10161025        studentview = StudentBasePDFFormPage(self.context.student,
    1017             self.request)
     1026            self.request, ('password', 'suspended', 'phone', 'adm_code', 'sex'))
    10181027        students_utils = getUtility(IStudentsUtils)
    10191028        tabledata = sorted(self.context.values(),
     
    14261435        #    return
    14271436        studentview = StudentBasePDFFormPage(self.context.student,
    1428             self.request)
     1437            self.request, ('password', 'suspended', 'phone', 'adm_code', 'sex'))
    14291438        students_utils = getUtility(IStudentsUtils)
    14301439        return students_utils.renderPDF(self, 'payment_slip.pdf',
     
    16551664    def render(self):
    16561665        studentview = StudentBasePDFFormPage(self.context.student,
    1657             self.request)
     1666            self.request, ('password', 'suspended', 'phone', 'adm_code', 'sex'))
    16581667        students_utils = getUtility(IStudentsUtils)
    16591668        return students_utils.renderPDF(
Note: See TracChangeset for help on using the changeset viewer.