Commit fcc365c5 authored by Antoine Catton's avatar Antoine Catton

Change the software_instance_tree table

- Use Hosting Subscribtion as root
- Rename 'SoftwareInstance_getSoftwareInstanceUid' into
  'SoftwareInstance_getHostingSubscriptionUid' to have a meanful name.
parent 728a7206
......@@ -50,12 +50,27 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>predecessor_software_instance = context\n
<value> <string># Did not import Products.ERP5Security.ERP5GroupManager\n
# because of semantic matter.\n
class ConsistencyError(Exception):\n
pass\n
\n
predecessor_software_instance = context\n
while (predecessor_software_instance is not None):\n
root_software_instance = predecessor_software_instance\n
predecessor_software_instance = predecessor_software_instance.getPredecessorRelatedValue(\n
portal_type=["Software Instance", "Slave Instance"])\n
return root_software_instance.getUid()\n
\n
root_hosting_subscription = root_software_instance.getPredecessorRelatedValue(\n
portal_type=["Hosting Subscription"])\n
\n
# XXX-Antoine: As Romain wanted it, we raise an error if it\'s not attached to a\n
# root Hosting Subscription.\n
if root_hosting_subscription is None:\n
raise ConsistencyError(("Software instance %s has no hosting "\n
"subscription as root.") % context.getReference())\n
\n
return root_hosting_subscription.getUid()\n
</string> </value>
</item>
<item>
......@@ -64,7 +79,7 @@ return root_software_instance.getUid()\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getRootSoftwareInstanceUid</string> </value>
<value> <string>SoftwareInstance_getRootHostingSubscriptionUid</string> </value>
</item>
</dictionary>
</pickle>
......
326
\ No newline at end of file
327
\ No newline at end of file
......@@ -15,7 +15,7 @@
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\r\n
SoftwareInstance_getRootSoftwareInstanceUid</string> </value>
SoftwareInstance_getRootHostingSubscriptionUid</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
......@@ -69,7 +69,7 @@ WHERE\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-call expr="row_list.append([\n
uid[loop_item],\n
SoftwareInstance_getRootSoftwareInstanceUid[loop_item]])">\n
SoftwareInstance_getRootHostingSubscriptionUid[loop_item]])">\n
</dtml-in>\n
\n
<dtml-if "row_list">\n
......
32
\ No newline at end of file
33
\ No newline at end of file
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