Changeset 10575
- Timestamp:
- 2 Sep 2013, 06:40:49 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/reports
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r10574 r10575 26 26 from waeup.kofa.reports import IReport 27 27 from waeup.kofa.browser.pdf import get_signature_tables 28 from waeup.kofa.students.reports.student_statistics import ( 29 StudentStatisticsReportPDFView) 28 30 29 31 class ILevelReport(IReport): … … 256 258 return 257 259 258 class LevelReportPDFView( grok.View):260 class LevelReportPDFView(StudentStatisticsReportPDFView): 259 261 260 262 grok.context(ILevelReport) 261 263 grok.name('pdf') 262 264 grok.require('waeup.Public') 263 264 def render(self): 265 filename = 'LevelReport_%s_%s_%s_%s_%s.pdf' % ( 265 prefix = 'LevelReport' 266 267 def _filename(self): 268 return 'LevelReport_%s_%s_%s_%s_%s.pdf' % ( 266 269 self.context.faccode, self.context.depcode, 267 270 self.context.sessioncode, self.context.levelcode, 268 271 self.context.creation_dt_string) 269 filename = filename.replace( 270 '/', '_').replace(' ','_').replace(':', '-') 271 self.response.setHeader( 272 'Content-Type', 'application/pdf') 273 self.response.setHeader( 274 'Content-Disposition:', 'attachment; filename="%s' % filename) 275 pdf_stream = self.context.create_pdf() 276 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 277 grok.getSite().logger.info('%s - report %s downloaded: %s' % ( 278 ob_class, self.context.__name__, filename)) 279 return pdf_stream 272 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py
r10565 r10575 221 221 grok.name('pdf') 222 222 grok.require('waeup.Public') 223 224 def render(self): 225 filename = 'StudentStatisticsReport_%s_%s_%s.pdf' % ( 223 prefix = '' 224 225 def _filename(self): 226 return 'StudentStatisticsReport_%s_%s_%s.pdf' % ( 226 227 self.context.session, self.context.mode, 227 228 self.context.creation_dt_string) 228 filename = filename.replace( 229 230 def render(self): 231 filename = self._filename().replace( 229 232 '/', '_').replace(' ','_').replace(':', '-') 230 233 self.response.setHeader(
Note: See TracChangeset for help on using the changeset viewer.