def action_on_success(self, resource, context): # XXX Set image as public form = Table_AddRecord._get_form(self, resource, context) path = form['name'] img_resource = resource.get_resource(str(path)) img_resource.set_property('state', 'public') return context.come_back(MSG(u'New record added.'))
def _get_form(self, resource, context): form = Table_AddRecord._get_form(self, resource, context) # We check if the image path refer to an Image instance path = form['name'] check_photo(path, resource, 'name') return form