Commit 858f9c99 authored by Jérome Perrin's avatar Jérome Perrin

support importing id

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37395 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e3508225
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
forbidden_property = (\'uid\', \'id\', \'portal_type\',)\n forbidden_property = (\'uid\', \'portal_type\',)\n
match_property_list = []\n match_property_list = []\n
\n \n
\n \n
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>module = context\n <value> <string>module = context\n
\n \n
forbidden_property = [\'uid\', \'id\', \'portal_type\']\n forbidden_property = [\'uid\', \'portal_type\']\n
property_list = []\n property_list = []\n
\n \n
for portal_type in module.allowedContentTypes():\n for portal_type in module.allowedContentTypes():\n
......
...@@ -101,18 +101,17 @@ else:\n ...@@ -101,18 +101,17 @@ else:\n
# Get portal type objects\n # Get portal type objects\n
base_category_list = portal_type_object.getInstanceBaseCategoryList()\n base_category_list = portal_type_object.getInstanceBaseCategoryList()\n
\n \n
# Create the object\n
new_object = container.newContent(portal_type=portal_type)\n
\n
# Separate categories from properties\n # Separate categories from properties\n
imported_line_category_dict = {}\n imported_line_category_dict = {}\n
for prop_key in imported_line_property_dict.keys():\n for prop_key in imported_line_property_dict.keys():\n
if prop_key in base_category_list:\n if prop_key in base_category_list:\n
imported_line_category_dict[prop_key] = imported_line_property_dict.pop(prop_key)\n imported_line_category_dict[prop_key] = imported_line_property_dict.pop(prop_key)\n
\n \n
new_object = None\n
# Save properties on object\n # Save properties on object\n
try:\n try:\n
new_object.edit(**imported_line_property_dict)\n new_object = container.newContent(portal_type=portal_type,\n
**imported_line_property_dict)\n
except ConflictError:\n except ConflictError:\n
raise\n raise\n
except Exception, error:\n except Exception, error:\n
...@@ -239,10 +238,10 @@ else:\n ...@@ -239,10 +238,10 @@ else:\n
<string>dict</string> <string>dict</string>
<string>translated_msg</string> <string>translated_msg</string>
<string>base_category_list</string> <string>base_category_list</string>
<string>new_object</string>
<string>imported_line_category_dict</string> <string>imported_line_category_dict</string>
<string>prop_key</string> <string>prop_key</string>
<string>_write_</string> <string>_write_</string>
<string>new_object</string>
<string>_apply_</string> <string>_apply_</string>
<string>Exception</string> <string>Exception</string>
<string>error</string> <string>error</string>
......
404 405
\ No newline at end of file \ No newline at end of file
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