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 @@ ...@@ -54,8 +54,7 @@
><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n ><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n
field_errors python: request.get(\'field_errors\',{});\n field_errors python: request.get(\'field_errors\',{});\n
dummy python: request.set(\'here\',here);\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></tal:block>
</tal:block>
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n ><tal:block tal:define="groups python: form.get_groups(include_empty=1);\n
field_errors python: request.get(\'field_errors\',{});\n field_errors python: request.get(\'field_errors\',{});\n
dummy python: request.set(\'here\',here);\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> </tal:block>
]]></string> </value> ]]></string> </value>
......
...@@ -68,7 +68,12 @@ ...@@ -68,7 +68,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n <value> <string>request = context.REQUEST\n
\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 \n
return request[ \'RESPONSE\' ].redirect( redirect_url )\n return request[ \'RESPONSE\' ].redirect( redirect_url )\n
</string> </value> </string> </value>
...@@ -85,7 +90,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -85,7 +90,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id=\'\'</string> </value> <value> <string>form_id=\'\', export_only=1</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -105,16 +110,20 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -105,16 +110,20 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>form_id</string> <string>form_id</string>
<string>export_only</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>request</string> <string>request</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>kw</string>
<string>redirect_url</string> <string>redirect_url</string>
<string>_getitem_</string> <string>_getitem_</string>
</tuple> </tuple>
...@@ -130,6 +139,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -130,6 +139,7 @@ return request[ \'RESPONSE\' ].redirect( redirect_url )\n
<value> <value>
<tuple> <tuple>
<string></string> <string></string>
<int>1</int>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -73,7 +73,9 @@ ...@@ -73,7 +73,9 @@
<item> <item>
<key> <string>Default</string> </key> <key> <string>Default</string> </key>
<value> <value>
<list/> <list>
<string>your_export_only</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -71,12 +71,11 @@ ...@@ -71,12 +71,11 @@
if object == None:\n if object == None:\n
object = context.newContent()\n object = context.newContent()\n
\n \n
# activity doesn t support security rights yet...\n # activity doesn\'t support security rights yet...\n
for key in [\'uid\',\'id\']:\n for key in [\'uid\',\'id\']:\n
if object_property_dict.has_key(key):\n if object_property_dict.has_key(key):\n
object_property_dict.pop(key)\n object_property_dict.pop(key)\n
\n \n
\n
object.edit(**object_property_dict)\n object.edit(**object_property_dict)\n
</string> </value> </string> </value>
</item> </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