Changeset 6762 for main/waeup.sirp/trunk
- Timestamp:
- 14 Sep 2011, 07:11:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6761 r6762 39 39 from waeup.sirp.students.workflow import CLEARANCE 40 40 41 # Save function used for save methods in manager pages 42 def msave(view, **data): 43 form = view.request.form 44 ob_class = view.__implemented__.__name__.replace('waeup.sirp.','') 45 changed_fields = view.applyData(view.context, **data) 46 changed_fields = changed_fields.values() 47 fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields) 48 view.context._p_changed = True 49 view.flash('Form has been saved.') 50 if fields_string: 51 try: 52 view.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 53 except AttributeError: 54 view.context.__parent__.loggerInfo(ob_class, 'saved: % s' % fields_string) 55 return 56 41 57 class StudentsTab(PrimaryNavTab): 42 58 """Students tab in primary navigation. … … 372 388 @grok.action('Save') 373 389 def save(self, **data): 374 changed_fields = self.applyData(self.context, **data) 375 changed_fields = changed_fields.values() 376 fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields) 377 self.context._p_changed = True 378 form = self.request.form 379 self.flash('Form has been saved.') 380 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 381 if fields_string: 382 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 390 msave(self, **data) 383 391 return 384 392 … … 416 424 pnav = 4 417 425 426 @grok.action('Save') 427 def save(self, **data): 428 msave(self, **data) 429 return 430 418 431 class StudyCourseDisplayFormPage(WAeUPDisplayFormPage): 419 432 """ Page to display the student study course data … … 452 465 @grok.action('Save') 453 466 def save(self, **data): 454 form = self.request.form 455 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 456 changed_fields = self.applyData(self.context, **data) 457 changed_fields = changed_fields.values() 458 fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields) 459 self.context._p_changed = True 460 self.flash('Form has been saved.') 461 if fields_string: 462 self.context.__parent__.loggerInfo(ob_class, 'saved: % s' % fields_string) 467 msave(self, **data) 463 468 return 464 469
Note: See TracChangeset for help on using the changeset viewer.