Changeset 8737 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 17 Jun 2012, 07:32:08 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 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
Note: See TracChangeset for help on using the changeset viewer.