Commit e5184879 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_dat_notebook bt5: Add External method base_savePlot and use Image module...

erp5_dat_notebook bt5: Add External method base_savePlot and use Image module as context while creating new Image Object in base_savePlot
parent 9eab2df8
......@@ -276,14 +276,15 @@ def Base_savePlot(self, plot=None, reference=None):
buff.seek(0)
data = buff.getvalue()
# Add new Image object in erp5 with id and reference
import time
image_id = reference+str(time.time())
self.newContent(
# Add new Image object in erp5 with id and reference
image_module = self.getDefaultModule(portal_type='Image')
image_module.newContent(
portal_type='Image',
id=image_id,
reference=reference,
data=data,
filename=filename)
return None
\ No newline at end of file
return None
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>Base_savePlot</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>JupyterCompile</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_savePlot</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Base_savePlot</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