Changeset 14516 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 8 Feb 2017, 07:56:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/student_level_statistics.py
r14374 r14516 74 74 cat = queryUtility(ICatalog, name="students_catalog") 75 75 result = cat.searchResults(current_session=(session, session)) 76 table = [[0 for x in xrange(2 * len(levels) + 2)] for y in xrange(len(paths)+1)] 76 table = [[0 for x in xrange(2 * len(levels) + 2)] 77 for y in xrange(len(paths)+1)] 77 78 mode_groups = getUtility(IKofaUtils).MODE_GROUPS 78 79 for stud in result: 79 if mode != 'All' and stud.current_mode not in mode_groups[mode]: 80 if mode != 'All' and stud.current_mode \ 81 and stud.current_mode not in mode_groups[mode]: 80 82 continue 81 83 if getattr(stud, breakdown) is None: … … 177 179 creator = getUtility(IPDFCreator, name='landscape') 178 180 table_data = tbl_data_to_table(*self.data) 179 col_widths = [None,] + [1.8*cm] * (len(self.data[1]) - 1)+ [2.0*cm] + [None,] 181 col_widths = [None,] + [1.8*cm] * ( 182 len(self.data[1]) - 1)+ [2.0*cm] + [None,] 180 183 pdf_data = [Paragraph('<b>%s - Report %s</b>' 181 184 % (self.creation_dt_string, job_id), 182 185 STYLE["Normal"]), 183 186 Spacer(1, 12),] 187 pdf_data += [Paragraph( 188 translate( 189 'Study Mode: ${a}<br />' 190 'Academic Session: ${b}', 191 mapping = {'a':self.mode, 192 'b':self.session, 193 }), 194 STYLE["Normal"]), 195 Spacer(1, 12),] 184 196 pdf_data += [ 185 197 Table(table_data, style=TABLE_STYLE, colWidths=col_widths)] 186 doc_title = translate( 187 _('${a} Students - ${c}', 188 mapping = {'a':self.mode, 'c':self.session})) 198 doc_title = translate(_('Student Level Statistics')) 189 199 pdf = creator.create_pdf( 190 pdf_data, None, doc_title, self.author, doc_title + ' -' 200 pdf_data, None, doc_title, self.author, 201 doc_title + ' - %s -' % self.session, 191 202 ) 192 203 return pdf … … 249 260 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 250 261 grok.getSite().logger.info( 251 '%s - report %s created: %s (session=%s, mode=%s, breakdown=%s)' % ( 262 '%s - report %s created: %s ' 263 '(session=%s, mode=%s, breakdown=%s)' % ( 252 264 ob_class, job_id, self.context.title, 253 265 session, mode, breakdown)) … … 278 290 279 291 def _filename(self): 280 return 'StudentLevelStatisticsReport_ %s_%s_%s.pdf' % (281 self.context. session, self.context.mode,292 return 'StudentLevelStatisticsReport_rno%s_%s.pdf' % ( 293 self.context.__name__, 282 294 self.context.creation_dt_string) 283 295
Note: See TracChangeset for help on using the changeset viewer.