Commit ac9bbe6b authored by Papa Tamsir Kane's avatar Papa Tamsir Kane

erp5_curation_request: Change reference getter

parent 2994c68f
aggregate = context.getAggregateValue()
if aggregate is not None:
return context.Base_translateString(aggregate.getPortalType())
else:
return 'Curation Record(s) / Url(s)'
<?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>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurationRequestLine_getAggregateLabel</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -73,8 +73,8 @@
<value>
<list>
<string>my_reference</string>
<string>my_title</string>
<string>my_aggregate_title</string>
<string>my_title</string>
</list>
</value>
</item>
......
......@@ -124,7 +124,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_translateString(here.getAggregateValue().getPortalType())</string> </value>
<value> <string>python: context.CurationRequestLine_getAggregateLabel()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -104,7 +104,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.CurationRequest_getReference(generator_id_group=\'curation_request_line_reference\')</string> </value>
<value> <string>python: context.Object_getIncrementalReference(generator_id_group=\'curation_request_line_reference\')</string> </value>
</item>
</dictionary>
</pickle>
......
portal = context.getPortalObject()
translate = portal.Base_translateString
assignment_dict = portal.ERP5Site_getPersonAssignmentDict()
#new_curation_record_title = 'curation_record_for_{}'.format(curation_request.getTitle())
curation_record = context.curation_record_module.newContent(portal_type='Curation Record')
curation_record_line = context.newContent(portal_type='Curation Request Line',
aggregate_value=curation_record,
quantity=1,)
quantity=1)
# set reference
curation_record_line.Object_getIncrementalReference(generator_id_group='curation_request_line_reference')
......@@ -104,7 +104,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.CurationRequest_getReference(generator_id_group=\'curation_request_reference\')</string> </value>
<value> <string>python: context.Object_getIncrementalReference(generator_id_group=\'curation_request_reference\')</string> </value>
</item>
</dictionary>
</pickle>
......
reference = context.getReference()
from DateTime import DateTime
'''
class MyException(Exception):
pass
raise MyException()
'''
if reference:
return reference
else:
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurationRequest_getReference</string> </value>
<value> <string>Object_getIncrementalReference</string> </value>
</item>
</dictionary>
</pickle>
......
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