Changeset 8737 for main/waeup.kofa/trunk/src
- Timestamp:
- 17 Jun 2012, 07:32:08 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8736 r8737 62 62 from waeup.kofa.browser.resources import toggleall 63 63 from waeup.kofa.hostels.hostel import NOT_OCCUPIED 64 from waeup.kofa.utils.helpers import get_current_principal, to_timezone, msave 64 from waeup.kofa.utils.helpers import get_current_principal, to_timezone 65 66 # Save function used for save methods in pages 67 def msave(view, **data): 68 changed_fields = view.applyData(view.context, **data) 69 # Turn list of lists into single list 70 if changed_fields: 71 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 72 # Inform catalog if certificate has changed 73 # (applyData does this only for the context) 74 if 'certificate' in changed_fields: 75 notify(grok.ObjectModifiedEvent(view.context.student)) 76 fields_string = ' + '.join(changed_fields) 77 view.flash(_('Form has been saved.')) 78 if fields_string: 79 view.context.writeLogMessage(view, 'saved: %s' % fields_string) 80 return 65 81 66 82 def emit_lock_message(view): -
main/waeup.kofa/trunk/src/waeup/kofa/students/container.py
r8410 r8737 39 39 _curr_stud_id = 10 ** 6 40 40 41 logger_name = 'waeup.kofa.${sitename}.students' 42 logger_filename = 'students.log' 43 41 44 @property 42 45 def unique_student_id(self): … … 77 80 return 78 81 79 logger_name = 'waeup.kofa.${sitename}.students'80 logger_filename = 'students.log'81 82 def logger_info(self, ob_class, target, comment=None):83 """Get the logger's info method.84 """85 self.logger.info('%s - %s - %s' % (86 ob_class, target, comment))87 return88 89 82 StudentsContainer = attrs_to_fields(StudentsContainer) -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r8736 r8737 63 63 def writeLogMessage(self, view, message): 64 64 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 65 return self.__parent__.logger_info(ob_class,self.__name__,comment=None) 65 self.__parent__.logger.info( 66 '%s - %s - %s' % (ob_class, self.__name__, message)) 67 return 66 68 67 69 @property -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
r8735 r8737 86 86 return 87 87 88 #def writeLogMessage(self, view, message): 89 # ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 90 # return self.__parent__.logger_info(ob_class,self.__name__,comment=None) 91 88 92 class CertificateFactory(grok.GlobalUtility): 89 93 """A factory for certificates. … … 151 155 studycourse.certificate = None 152 156 notify(grok.ObjectModifiedEvent(student)) 153 student.__parent__.logger _info(154 'ObjectRemovedEvent ',student.__name__,'removed: certificate')157 student.__parent__.logger.info( 158 'ObjectRemovedEvent - %s - removed: certificate' % student.__name__) 155 159 return 156 160 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r8736 r8737 690 690 if changed_fields: 691 691 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 692 # Inform catalog if certificate has changed693 # (applyData does this only for the context)694 if 'certificate' in changed_fields:695 notify(grok.ObjectModifiedEvent(view.context.student))696 692 fields_string = ' + '.join(changed_fields) 697 693 view.flash(_('Form has been saved.'))
Note: See TracChangeset for help on using the changeset viewer.