Commit 75ca2b4a authored by Jérome Perrin's avatar Jérome Perrin

Improve CSV import/export. Base_exportCsv doesn't use export_only by default....

Improve CSV import/export. Base_exportCsv doesn't use export_only by default. Import never change uid or id

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6307 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7ec35e7
......@@ -54,8 +54,7 @@
><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n
field_errors python: request.get(\'field_errors\',{});\n
dummy python: request.set(\'here\',here);\n
listbox python:form[\'listbox\'];" ><tal:block tal:content="python: listbox.Listbox_exportCsv()" /></tal:block></tal:block>\n
</tal:block>
listbox python:form[\'listbox\'];" ><tal:block tal:content="python: listbox.Listbox_exportCsv(export_only=request.get(\'export_only\', 1))" /></tal:block></tal:block></tal:block>
]]></string> </value>
</item>
......
......@@ -62,7 +62,7 @@
><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n
field_errors python: request.get(\'field_errors\',{});\n
dummy python: request.set(\'here\',here);\n
listbox python:form[\'listbox\'];" ><tal:block tal:content="python: listbox.Listbox_exportCsv()" /></tal:block></tal:block>\n
listbox python:form[\'listbox\'];" ><tal:block tal:content="python: listbox.Listbox_exportCsv(export_only=request.get(\'export_only\', 1))" /></tal:block></tal:block>\n
</tal:block>
]]></string> </value>
......
......@@ -68,7 +68,12 @@
<key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n
\n
redirect_url = \'%s?%s\' % ( context.absolute_url()+\'/\'+form_id, \'portal_skin=CSV\')\n
from ZTUtils import make_query\n
kw = { \'portal_skin\' : \'CSV\',\n
\'export_only\' : export_only }\n
\n
redirect_url = \'%s?%s\' % ( context.absolute_url()+\'/\'+form_id, \n
make_query(kw) )\n
\n
return request[ \'RESPONSE\' ].redirect( redirect_url )\n
</string> </value>
......@@ -85,7 +90,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=\'\'</string> </value>
<value> <string>form_id=\'\', export_only=1</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -105,16 +110,20 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>form_id</string>
<string>export_only</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>kw</string>
<string>redirect_url</string>
<string>_getitem_</string>
</tuple>
......@@ -130,6 +139,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
<value>
<tuple>
<string></string>
<int>1</int>
</tuple>
</value>
</item>
......
......@@ -73,7 +73,9 @@
<item>
<key> <string>Default</string> </key>
<value>
<list/>
<list>
<string>your_export_only</string>
</list>
</value>
</item>
<item>
......
......@@ -71,12 +71,11 @@
if object == None:\n
object = context.newContent()\n
\n
# activity doesn t support security rights yet...\n
for key in [\'uid\',\'id\']:\n
# activity doesn\'t support security rights yet...\n
for key in [\'uid\',\'id\']:\n
if object_property_dict.has_key(key):\n
object_property_dict.pop(key)\n
\n
\n
object.edit(**object_property_dict)\n
</string> </value>
</item>
......
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