Ignore:
Timestamp:
20 Jun 2013, 19:41:56 (12 years ago)
Author:
Henrik Bettermann
Message:

Render two-column table of tables (not yet tested in custom packages).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py

    r10317 r10319  
    5353    column_two_fields = ('applicant_id', 'reg_number',
    5454        'firstname', 'middlename', 'lastname')
     55    two_columns_design_fields = []
    5556
    5657    @property
     
    132133
    133134        # create two-column header table
    134         data_left = []
    135         data_right = []
    136135        # append photograph to the left
    137136        img_path = getattr(
    138137            getUtility(IExtFileStore).getFileByContext(self.context),
    139138            'name', DEFAULT_PASSPORT_IMAGE_PATH)
    140         data_left.append([creator.getImage(img_path)])
     139        data_left = [[creator.getImage(img_path)]]
    141140        table_left = Table(data_left,style=SLIP_STYLE)
     141
    142142        # append column-two fields to the right
    143143        fields = [
     
    150150        data.append(header_table)
    151151
     152        # append two-column table of widgets of those fields defined in
     153        # two_columns_design_fields
     154        fields = [
     155            field for field in self.form_fields
     156                if not field.__name__ in self.column_two_fields and
     157                field.__name__ in self.two_columns_design_fields]
     158        if fields:
     159            data.append(creator.getWidgetsTable(
     160                fields, self.context, view, lang=portal_language,
     161                domain='waeup.kofa', twoDataCols=True))
     162
    152163        # append widgets except those already added in column two
    153164        dept, faculty = self._getDeptAndFaculty()
    154165        fields = [
    155166            field for field in self.form_fields
    156                 if not field.__name__ in self.column_two_fields]
     167                if not field.__name__ in self.column_two_fields and
     168                not field.__name__ in self.two_columns_design_fields]
    157169        data.append(creator.getWidgetsTable(
    158170            fields, self.context, view, lang=portal_language,
Note: See TracChangeset for help on using the changeset viewer.