app/soc/views/models/base.py
changeset 1864 3d50c8c34d6a
parent 1844 006ca71ed07a
child 1878 25116444358c
equal deleted inserted replaced
1863:d5272c2ded9f 1864:3d50c8c34d6a
   544 
   544 
   545     if export is not None and export < len(contents):
   545     if export is not None and export < len(contents):
   546       content = contents[export]
   546       content = contents[export]
   547       key_order = content.get('key_order')
   547       key_order = content.get('key_order')
   548 
   548 
   549       data = [i.toDict(key_order) for i in content['data']]
   549       if key_order:
   550 
   550         data = [i.toDict(key_order) for i in content['data']]
   551       if not key_order:
   551 
   552         data = [i.values() for i in data]
   552         filename = "export_%d" % export
   553 
   553         return self.csv(request, data, filename, params, key_order)
   554       filename = "export_%d" % export
       
   555       return self.csv(request, data, filename, params, key_order)
       
   556 
   554 
   557     context = dicts.merge(context,
   555     context = dicts.merge(context,
   558         helper.responses.getUniversalContext(request))
   556         helper.responses.getUniversalContext(request))
   559     helper.responses.useJavaScript(context, params['js_uses_all'])
   557     helper.responses.useJavaScript(context, params['js_uses_all'])
   560     context['page_name'] = page_name
   558     context['page_name'] = page_name