web/views/json.py
branchstable
changeset 8651 353bbd17a8b6
parent 8629 3ae893f9ec84
child 8657 5ab6ec83d5ba
equal deleted inserted replaced
8650:9a6e80bfad9d 8651:353bbd17a8b6
   109     """
   109     """
   110     __regid__ = 'ejsonexport'
   110     __regid__ = 'ejsonexport'
   111     title = _('json-entities-export-view')
   111     title = _('json-entities-export-view')
   112 
   112 
   113     def call(self):
   113     def call(self):
   114         entities = []
   114         if self.cw_rset is None:
   115         for entity in self.cw_rset.entities():
   115             self.wdata([self.cw_extra_kwargs.get('entity')])
   116             entity.complete() # fetch all attributes
   116         else:
   117             # hack to add extra metadata
   117             self.wdata(list(self.cw_rset.entities()))
   118             entity.cw_attr_cache.update({
       
   119                     '__cwetype__': entity.__regid__,
       
   120                     })
       
   121             entities.append(entity)
       
   122         self.wdata(entities)