Commit 213f84df authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify expression.

Add another JSON getter.
parent df051c64
......@@ -57,14 +57,12 @@ kw.update(\n
portal_type=\'Software Product\',\n
validation_state=\'published\',\n
limit=(offset, limit),\n
offset=offset,\n
title=title\n
)\n
script.log(context.getPortalObject().portal_catalog(src__=1, **kw))\n
if title:\n
for software_product in context.getPortalObject().portal_catalog(**kw\n
):\n
response.append({\'title\': software_product.getTitle(), \'image\': software_product.getDefaultImageAbsoluteUrl() + \'/Base_download\', \'uid\': str(software_product.getUid())})\n
response.append({\'title\': software_product.getTitle(), \'image\': software_product.getDefaultImageAbsoluteUrl() + \'/Base_download\', \'uid\': software_product.getUid()})\n
return context.asJSON(response)\n
</string> </value>
</item>
......
<?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>response = []\n
\n
portal_catalog = context.getPortalObject().portal_catalog\n
kw = {}\n
kw.update(\n
portal_type=\'Software Release\',\n
validation_state=\'published\',\n
limit=(offset, limit),\n
title=title,\n
aggregate_relative_url=portal_catalog.getResultValue(uid=software_product_uid).getRelativeUrl()\n
)\n
if title:\n
for software_release in portal_catalog(**kw\n
):\n
response.append({\'title\': software_release.getTitle(), \'uid\': software_release.getUid(), \'version\': software_release.getVersion()})\n
return context.asJSON(response)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>software_product_uid, title, offset=0, limit=10</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getSoftwareReleaseListAsJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
319
\ No newline at end of file
320
\ 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