Changeset 10562 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 29 Aug 2013, 15:12:04 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r10560 r10562 158 158 def generate(self, site, faccode=None, depcode=None, 159 159 session=None, level=None, author=None): 160 result = LevelReport Report(faccode=faccode, depcode=depcode,161 160 result = LevelReport(faccode=faccode, depcode=depcode, 161 session=session, level=level, author=author) 162 162 return result 163 163 … … 192 192 self._set_level_values() 193 193 self._set_faccode_depcode_values() 194 #faccode = faccode_depcode.split('_')[0]195 #depcode = faccode_depcode.split('_')[1]196 194 if CREATE and session: 197 195 # create a new report job for students by session 196 faccode = faccode_depcode.split('_')[0] 197 depcode = faccode_depcode.split('_')[1] 198 198 container = self.context.__parent__ 199 199 user_id = self.request.principal.id … … 208 208 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 209 209 grok.getSite().logger.info( 210 '%s - report %s created: %s ( session=%s, mode=%s)' % (211 ob_class, job_id, self.context.title, session, mode))210 '%s - report %s created: %s (faculty=%s, department=%s, session=%s, level=%s)' % ( 211 ob_class, job_id, self.context.title, faccode, depcode, session, level)) 212 212 self.redirect(self.parent_url) 213 213 return … … 225 225 226 226 def _set_faccode_depcode_values(self): 227 # Not yet implemented 228 self.faccode_depcodes = None 229 return 230 227 faccode_depcodes = [] 228 faculties = grok.getSite()['faculties'] 229 for fac in faculties.values(): 230 for dep in fac.values(): 231 faccode_depcodes.append( 232 ('%s (%s)' %(dep.longtitle(), fac.longtitle()), 233 '%s_%s' %(fac.code, dep.code))) 234 self.faccode_depcodes = sorted( 235 faccode_depcodes, key=lambda value: value[0]) 236 return 231 237 232 238 class LevelReportPDFView(grok.View): … … 237 243 238 244 def render(self): 239 filename = 'LevelReport_%s_%s_%s.pdf' % ( 240 self.context.session, self.context.mode, 245 filename = 'LevelReport_%s_%s_%s_%s_%s.pdf' % ( 246 self.context.faccode, self.context.depcode, 247 self.context.sessioncode, self.context.levelcode, 241 248 self.context.creation_dt_string) 242 249 filename = filename.replace(
Note: See TracChangeset for help on using the changeset viewer.