src/pyams_content/component/extfile/zmi/container.py
changeset 7 cbc55162b64e
parent 0 7c0001cacf8e
child 140 67bad9f880ee
equal deleted inserted replaced
6:b952eda9bb42 7:cbc55162b64e
   249 
   249 
   250 @view_config(name='extfile-links.json', context=IExtFileLinksContainerTarget, request_type=IPyAMSLayer,
   250 @view_config(name='extfile-links.json', context=IExtFileLinksContainerTarget, request_type=IPyAMSLayer,
   251              permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
   251              permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
   252 class ExtFileLinksContainerAJAXEditForm(AJAXEditForm, ExtFileLinksContainerLinksEditForm):
   252 class ExtFileLinksContainerAJAXEditForm(AJAXEditForm, ExtFileLinksContainerLinksEditForm):
   253     """External file links container edit form, JSON renderer"""
   253     """External file links container edit form, JSON renderer"""
       
   254 
       
   255     def get_ajax_output(self, changes):
       
   256         if 'files' in changes.get(IExtFileLinksContainer, ()):
       
   257             return {'status': 'success',
       
   258                     'event': 'PyAMS_content.changed_item',
       
   259                     'event_options': {'object_type': 'extfiles_container',
       
   260                                       'object_name': self.context.__name__,
       
   261                                       'nb_files': len(IExtFileLinksContainer(self.context).files or ())}}
       
   262         else:
       
   263             return super(ExtFileLinksContainerAJAXEditForm, self).get_ajax_output(changes)