Commit 2b311891 authored by Guillaume Hervier's avatar Guillaume Hervier

slapos_cloud: HostingSubscription_view: Add links to access elements from...

slapos_cloud: HostingSubscription_view: Add links to access elements from columns in instances list.
parent b8d5e234
......@@ -95,9 +95,7 @@
<value>
<list>
<string>listbox_aggregate_parent_title</string>
<string>listbox_aggregate_default_ipv6</string>
<string>listbox_is_slave</string>
<string>listbox_aggregate_parent_reference</string>
</list>
</value>
</item>
......@@ -108,6 +106,7 @@
<string>my_title</string>
<string>my_reference</string>
<string>my_source_reference</string>
<string>listbox_aggregate_parent_reference</string>
</list>
</value>
</item>
......
......@@ -20,6 +20,7 @@
<string>search_columns</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
......@@ -139,11 +140,11 @@
<string>Computer Ref.</string>
</tuple>
<tuple>
<string>getAggregateTitle</string>
<string>aggregate_title</string>
<string>Computer Partition</string>
</tuple>
<tuple>
<string>aggregate_default_ipv6</string>
<string>SoftwareInstance_getComputerPartitionIPv6</string>
<string>IPv6</string>
</tuple>
<tuple>
......@@ -228,6 +229,25 @@
<key> <string>title</string> </key>
<value> <string>Software Instances</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>aggregate_title</string>
<string>SoftwareInstance_getPartitionUrl</string>
</tuple>
<tuple>
<string>aggregate_parent_title</string>
<string>SoftwareInstance_getComputerUrl</string>
</tuple>
<tuple>
<string>aggregate_parent_reference</string>
<string>SoftwareInstance_getComputerUrl</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......
if brain is None:
brain = context
partition = brain.getAggregateValue()
if partition is None:
return None
computer = partition.getParent()
if url_dict: # If RenderJS UI
jio_key = computer.getRelativeUrl()
return {
'command': 'push_history',
'view_kw': {
'view': 'view',
'jio_key': jio_key,
},
'options': {
'jio_key': jio_key
},
}
else:
return computer.absolute_url()
<?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>_params</string> </key>
<value> <string>url_dict=False, brain=None, selection=None, selection_name=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getComputerUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Script to generate URL for computer partiton of Software Instances
# both for XHTML UI as well as renderJS UI
if brain is None:
brain = context
# 'brain' in this case is the Software Instance, hence trying to get
# the partition as it it related to the Software Instance with 'aggregate'
# category, hence, this will get us the relative URL of the aggregate
partition = brain.getAggregateValue()
if partition is None:
return None
if url_dict: # if RenderJS UI
jio_key = partition.getRelativeUrl()
return {
'command': 'push_history',
'view_kw': {
'view': 'view',
'jio_key': jio_key,
},
'options': {
'jio_key': jio_key
},
}
else:
return partition.absolute_url()
<?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>_params</string> </key>
<value> <string>url_dict=False, brain=None, selection=None, selection_name=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getPartitionUrl</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