<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
        <tuple/>
      </tuple>
    </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>from ZTUtils import make_query\n
\n
request=context.REQUEST\n
\n
form = getattr(context,form_id)\n
field = form.get_field(field_id)\n
base_category = field.get_value(\'base_category\')\n
portal_type = map(lambda x:x[0],field.get_value(\'portal_type\'))\n
kw = {}\n
for k, v in field.get_value(\'parameter_list\') :\n
  kw[k] = v\n
jump_reference_list = context.getAcquiredValueList(base_category, portal_type=portal_type, filter=kw)\n
\n
if len(jump_reference_list)==1:\n
  jump_reference = jump_reference_list[0]\n
  return request[ \'RESPONSE\' ].redirect( \'%s/view\' % jump_reference.absolute_url() )\n
else:\n
  selection_uid_list = map(lambda x:x.getUid(),jump_reference_list)\n
  kw = {\'uid\': selection_uid_list}\n
  context.portal_selections.setSelectionParamsFor(\'Base_jumpToRelatedObjectList\',kw)\n
  request.set(\'object_uid\', context.getUid())\n
  request.set(\'uids\', selection_uid_list)\n
  return context.Base_jumpToRelatedObjectList(uids=selection_uid_list, REQUEST=request)\n
</string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>form_id, field_id, selection_index=0, selection_name=\'\'</string> </value>
        </item>
        <item>
            <key> <string>errors</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>func_code</string> </key>
            <value>
              <object>
                <klass>
                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>co_argcount</string> </key>
                        <value> <int>4</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>form_id</string>
                            <string>field_id</string>
                            <string>selection_index</string>
                            <string>selection_name</string>
                            <string>ZTUtils</string>
                            <string>make_query</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>request</string>
                            <string>getattr</string>
                            <string>form</string>
                            <string>field</string>
                            <string>base_category</string>
                            <string>map</string>
                            <string>portal_type</string>
                            <string>kw</string>
                            <string>_getiter_</string>
                            <string>k</string>
                            <string>v</string>
                            <string>_write_</string>
                            <string>jump_reference_list</string>
                            <string>len</string>
                            <string>_getitem_</string>
                            <string>jump_reference</string>
                            <string>selection_uid_list</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <int>0</int>
                <string></string>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Base_jumpToRelatedDocument</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
