Commit 13cb76ed authored by Kevin Deldycke's avatar Kevin Deldycke

Checks if section Items have a getIntIndex()-Method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9686 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e888d858
...@@ -158,7 +158,10 @@ for my_element in my_list:\n ...@@ -158,7 +158,10 @@ for my_element in my_list:\n
def compareIndex(c1, c2):\n def compareIndex(c1, c2):\n
c1_value = c1.getObject() \n c1_value = c1.getObject() \n
c2_value = c2.getObject() \n c2_value = c2.getObject() \n
return cmp(c1_value.getIntIndex(), c2_value.getIntIndex()) \n if hasattr(c1_value,\'getIntIndex\') and hasattr(c2_value,\'getIntIndex\') :\n
return cmp(c1_value.getIntIndex(), c2_value.getIntIndex()) \n
else:\n
return 0\n
\n \n
my_clean_list.sort(compareIndex)\n my_clean_list.sort(compareIndex)\n
return my_clean_list\n return my_clean_list\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