Commit d95ac22d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Add custom ERP5Type_asSecurityGroupIdSet

  We need to handle the order of source_project + function (sort) a non-standard way.
parent 0ff6c8ec
def handleSort(_category_dict):
# Ensure that destination_project + function and source_project + function
# generates the same Security ID. This workarround is required because
# the value already arrives at this point pre-sorted on various locations
# and it is not possible to change since it is widely used.
if _category_dict.keys() == ['function', 'source_project']:
return ['source_project', 'function']
# Enforce return list in case
return list(_category_dict)
return context.portal_skins.erp5_core.ERP5Type_asSecurityGroupIdSet(
category_dict=category_dict, key_sort=handleSort)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>_params</string> </key>
<value> <string>category_dict, key_sort=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Type_asSecurityGroupIdSet</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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