<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string># Define a dictionary where we store the subfields to display.\n
sub_field_dict = {}\n
split_depth = 1\n
# Try to assign each item to a sub field.\n
for item in item_list:\n
  # Get value of the item\n
  item_value = item[int(not is_right_display)]\n
  # Hash key from item_value\n
  item_split = item_value.split(\'/\')\n
  item_key = \'/\'.join(item_split[:split_depth])\n
  base_category = item_split[0]\n
  # Create a new subfield if necessary\n
  if not sub_field_dict.has_key(item_key):\n
    # Create property dict (key are field parameters)\n
    sub_field_property_dict = default_sub_field_property_dict.copy()\n
    sub_field_property_dict[\'key\'] = item_key\n
    sub_field_property_dict[\'title\'] = context.portal_categories[base_category].getTitle()\n
    sub_field_property_dict[\'required\'] = 0\n
    sub_field_property_dict[\'field_type\'] = \'ListField\'\n
    sub_field_property_dict[\'size\'] = 1\n
    sub_field_property_dict[\'item_list\'] = [(\'\', \'\')]\n
    sub_field_property_dict[\'value\'] = None\n
    sub_field_dict[item_key] = sub_field_property_dict\n
  # Put the value in the correct sub field.\n
  sub_field_dict[item_key][\'item_list\'].append(item)\n
  if item_value in value_list and sub_field_property_dict[\'value\'] is None:\n
    sub_field_dict[item_key][\'value\'] = item_value\n
\n
# Return the list of subfield configuration.\n
\n
return sub_field_dict.values()\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>item_list, value_list, default_sub_field_property_dict={}, is_right_display=0</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Base_getLineListFieldPropertyDictList</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
