Changeset 6360 for main/waeup.sirp


Ignore:
Timestamp:
12 Jun 2011, 20:06:56 (13 years ago)
Author:
Henrik Bettermann
Message:

Now exports passport picture into pdf. libjpeg62-dev must be installed!

Location:
main/waeup.sirp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/setup.py

    r6349 r6360  
    2323    'megrok.layout',
    2424    'reportlab',
     25    'PIL',
    2526    'zope.app.authentication', # BBB: During switch to grok 1.1
    2627    'zope.app.file',
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6359 r6360  
    540540    form_fields = grok.AutoFields(IApplicant).omit(
    541541        'locked').omit('course_admitted')
    542     form_fields['passport'].custom_widget = ThumbnailWidget
     542    #form_fields['passport'].custom_widget = ThumbnailWidget
    543543    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    544544
     
    570570        from reportlab.lib.pagesizes import A4, landscape
    571571        from reportlab.lib.styles import getSampleStyleSheet
    572         from reportlab.platypus import Frame, Paragraph
     572        from reportlab.platypus import Frame, Paragraph, Image
    573573
    574574        pdf = canvas.Canvas('application_slip.pdf',pagesize=A4)
     
    578578        frame = Frame(1*cm,1*cm,width-(2*cm),height-(2*cm))
    579579        self.setUpWidgets()
    580         #import pdb; pdb.set_trace()
     580       
    581581        for widget in self.widgets:
    582582            if widget.name != 'form.passport':
    583583                ptext = widget()
    584584                story.append(Paragraph(ptext, style["Normal"]))
     585            else:
     586                #import pdb; pdb.set_trace()
     587                filename = widget._data.file.name
     588                im = Image(filename)
     589                story.append(im)
    585590        frame.addFromList(story,pdf)
    586591        self.response.setHeader(
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6292 r6360  
    13651365    grok.require('waeup.View')
    13661366    pnav = 1
    1367     form_fields = grok.AutoFields(ICourse)
     1367    #form_fields = grok.AutoFields(ICourse)
    13681368
    13691369    @property
     
    15401540    grok.require('waeup.View')
    15411541    pnav = 1
    1542     form_fields = grok.AutoFields(ICertificateCourse)
     1542    #form_fields = grok.AutoFields(ICertificateCourse)
    15431543
    15441544    @property
Note: See TracChangeset for help on using the changeset viewer.