Changeset 6475 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 25 Jun 2011, 08:44:21 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py
r6348 r6475 48 48 return 49 49 50 def getApplicantsRootLogger(self): 51 return grok.getSite()['applicants'].logger 50 #def getApplicantsRootLogger(self): 51 # return grok.getSite()['applicants'].logger 52 53 def loggerInfo(self, ob_class, comment=None): 54 target = self.__name__ 55 return grok.getSite()['applicants'].logger_info(ob_class,target,comment) 52 56 53 57 @property -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6471 r6475 640 640 header_title = getattr(grok.getSite(), 'name', u'Sample University') 641 641 story.append(Paragraph(header_title, style["Heading1"])) 642 #import pdb; pdb.set_trace()643 642 frame_header.addFromList(story,pdf) 644 643 … … 733 732 @grok.action('Save') 734 733 def save(self, **data): 735 self.applyData(self.context, **data) 734 #import pdb; pdb.set_trace() 735 changed_fields = self.applyData(self.context, **data) 736 changed_fields = changed_fields.values() 737 fields_string = '+'.join('+'.join('+'.join(str(i) for i in b)) for b in changed_fields) 736 738 self.context._p_changed = True 737 739 form = self.request.form … … 740 742 self.wf_info.fireTransition(transition_id) 741 743 self.flash('Form has been saved.') 742 self.context.getApplicantsRootLogger().info('Saved') 744 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 745 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 743 746 return 744 747 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r6444 r6475 30 30 from waeup.sirp.utils.logger import ISiteLoggers 31 31 from waeup.sirp.applicants.interfaces import IApplicantsRoot 32 from waeup.sirp.utils.helpers import get_current_principal 32 33 33 34 class ApplicantsRoot(grok.Container): … … 47 48 loggers.register('waeup.sirp.%s.applicants') 48 49 return loggers.getLogger('waeup.sirp.%s.applicants') 50 51 def logger_info(self, target, ob_class, comment=None): 52 """Get the logger's info method. 53 """ 54 user = get_current_principal() 55 if user is None: 56 user = 'system' 57 elif user.title == 'Applicant': 58 user = 'applicant' 59 else: 60 user = user.id 61 self.logger.info('%s - %s - %s - %s' % (user, target, ob_class, comment)) 49 62 50 63 class ApplicantsPlugin(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.