Changeset 6761 for main/waeup.sirp/trunk


Ignore:
Timestamp:
14 Sep 2011, 06:40:03 (13 years ago)
Author:
Henrik Bettermann
Message:

Add save method with logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6760 r6761  
    450450    pnav = 4
    451451
     452    @grok.action('Save')
     453    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)
     463        return
     464
    452465class PaymentsDisplayFormPage(WAeUPDisplayFormPage):
    453466    """ Page to display the student payments
Note: See TracChangeset for help on using the changeset viewer.