Example #1
0
 def applyChanges(self, data):
     context = aq_inner(self.context)
     fti = getUtility(IDexterityFTI,
                      name='ade25.banner.contentbanner')
     schema = fti.lookupSchema()
     fields = getFieldsInOrder(schema)
     for key, value in fields:
         try:
             new_value = data[key]
             setattr(context, key, new_value)
         except KeyError:
             continue
     modified(context)
     context.reindexObject(idxs='modified')
     IStatusMessage(self.request).addStatusMessage(
         _(u"The banner has successfully been updated"),
         type='info')
     parent = aq_parent(context)
     next_url = parent.absolute_url()
     return self.request.response.redirect(next_url)
Example #2
0
 def handleCancel(self, action):
     context = aq_inner(self.context)
     IStatusMessage(self.request).addStatusMessage(
         _(u"Content block factory has been cancelled."),
         type='info')
     return self.request.response.redirect(context.absolute_url())