Changeset 6357 for main/waeup.sirp/trunk
- Timestamp:
- 12 Jun 2011, 07:04:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6355 r6357 31 31 32 32 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 33 34 from reportlab.pdfgen import canvas 33 35 34 36 from waeup.sirp.browser import ( … … 572 574 return 573 575 576 class PDFActionButton(ManageActionButton): 577 grok.context(IApplicant) 578 grok.view(DisplayApplicant) 579 grok.require('waeup.handleApplication') 580 icon = 'actionicon_pdf.png' 581 text = 'Download pdf slip' 582 target = 'application_slip.pdf' 583 584 class ExportPDFPage(grok.View): 585 """Deliver a PDF slip of the context. 586 """ 587 grok.context(IApplicant) 588 grok.name('application_slip.pdf') 589 grok.require('waeup.handleApplication') 590 591 # Render a demo pdf pagge 592 def render(self): 593 #exporter = IWAeUPXMLExporter(self.context) 594 #xml = exporter.export().read() 595 pdf = canvas.Canvas("application_slip.pdf") 596 pdf.drawString(100,750,"Welcome to Reportlab!") 597 self.response.setHeader( 598 'Content-Type', 'application/pdf') 599 return pdf.getpdfdata() 600 574 601 class EditApplicantStudent(EditApplicantFull): 575 602 """An applicant-centered edit view for applicant data.
Note: See TracChangeset for help on using the changeset viewer.