Commit a6dd6619 authored by Jérome Perrin's avatar Jérome Perrin

deferred style: use a generator for the list of report section

This uses much less memory
parent a3f0dbf7
......@@ -64,14 +64,14 @@ with portal.Localizer.translationContext(localizer_language):\n
\n
report_section_list = [r.getResult() for r in ap.getResultList()]\n
assert len(report_section_list) == report_section_count\n
report_section_list.sort(lambda a, b:cmp(a[0], b[0]))\n
report_section_list.sort(key=lambda x: x[0])\n
\n
def dummyReportMethod():\n
return report_section_list\n
\n
report_data = context.restrictedTraverse(form_path).report_view.pt_render(\n
extra_context=dict(options={\'format\': format},\n
rendered_report_item_list=[r[1].decode(\'zlib\') for r in report_section_list],\n
rendered_report_item_list=(r[1].decode(\'zlib\') for r in report_section_list),\n
report_method=dummyReportMethod,\n
form=portal.restrictedTraverse(form_path)))\n
\n
......@@ -82,6 +82,7 @@ with portal.Localizer.translationContext(localizer_language):\n
attachment_name = attachment_name[1:]\n
if attachment_name.endswith(\'"\'):\n
attachment_name = attachment_name[:-1]\n
\n
attachment_list = (\n
{\'mime_type\': (request.RESPONSE.getHeader(\'content-type\') or \'application/octet-stream;\').split(\';\')[0],\n
\'content\': \'%s\' % report_data,\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment