Commit 9fac911d authored by Yusei Tahara's avatar Yusei Tahara

Fixed a proxy field problem with a dirty way(to use meta_type).

Need to fix with other way (not to use meta_type is better).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15530 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c6b366b2
...@@ -83,6 +83,17 @@ base_category = None\n ...@@ -83,6 +83,17 @@ base_category = None\n
\n \n
o = context.restrictedTraverse(object_path)\n o = context.restrictedTraverse(object_path)\n
\n \n
# XXX We should not use meta_type properly,\n
# XXX We need to discuss this problem.(yusei)\n
def checkFieldType(field, field_type):\n
if field.meta_type==field_type:\n
return True\n
elif field.meta_type==\'ProxyField\':\n
template_field = field.getRecursiveTemplateField()\n
if template_field.meta_type==field_type:\n
return True\n
return False\n
\n
def checkSameKeys(a , b):\n def checkSameKeys(a , b):\n
"""\n """\n
Checks if the two lists contain\n Checks if the two lists contain\n
...@@ -138,7 +149,7 @@ try:\n ...@@ -138,7 +149,7 @@ try:\n
if same_type(new_value,\'a\'):\n if same_type(new_value,\'a\'):\n
new_value = [new_value]\n new_value = [new_value]\n
same_keys = 0\n same_keys = 0\n
if my_field.meta_type == \'MultiRelationStringField\':\n if checkFieldType(my_field, \'MultiRelationStringField\'):\n
# The checkProperty sometimes does not provide an\n # The checkProperty sometimes does not provide an\n
# acceptable value - XXXX - see vetement_id in Modele View\n # acceptable value - XXXX - see vetement_id in Modele View\n
if old_value is \'\' or old_value is None:\n if old_value is \'\' or old_value is None:\n
...@@ -233,7 +244,7 @@ try:\n ...@@ -233,7 +244,7 @@ try:\n
)\n )\n
else:\n else:\n
request.set(\'catalog_index\', my_field.get_value(\'catalog_index\'))\n request.set(\'catalog_index\', my_field.get_value(\'catalog_index\'))\n
if my_field.meta_type == \'MultiRelationStringField\':\n if checkFieldType(my_field, \'MultiRelationStringField\'):\n
request.set(\'relation_values\', request.get( my_field.id, None))\n request.set(\'relation_values\', request.get( my_field.id, None))\n
else:\n else:\n
request.set(\'relation_values\', [request.get( my_field.id, None)])\n request.set(\'relation_values\', [request.get( my_field.id, None)])\n
...@@ -325,6 +336,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -325,6 +336,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>None</string> <string>None</string>
<string>base_category</string> <string>base_category</string>
<string>o</string> <string>o</string>
<string>checkFieldType</string>
<string>checkSameKeys</string> <string>checkSameKeys</string>
<string>getOrderedUids</string> <string>getOrderedUids</string>
<string>getattr</string> <string>getattr</string>
......
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