Commit 0f361067 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_data_notebook bt5: Add comments in python scripts from portal_skin for this bt5

parent bb3fe819
......@@ -50,17 +50,28 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.CMFActivity.ActiveResult import ActiveResult\n
<value> <string>"""\n
Python script to add a new notebook to Data Notebook module.\n
This script also concerns for assigning an Active Process for each data notebook\n
created.\n
"""\n
from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
# Comment out person in case addition of person required to Data Notebook object\n
#person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
# Create new ActiveProcess object and getting its id\n
active_process = context.portal_activities.newActiveProcess()\n
active_process_id = active_process.getId()\n
\n
# Creating new dictionary via external method to save results in ZODB\n
new_dict = context.Base_addPersistentMapping()\n
# Add new ActiveResult object and add it to the activeprocess concerned with ...\n
# Data Notebook in concern\n
result = ActiveResult(summary=new_dict)\n
active_process.activateResult(result)\n
\n
# Create new notebook\n
notebook = context.newContent(\n
title=title,\n
reference=reference,\n
......@@ -68,14 +79,17 @@ notebook = context.newContent(\n
portal_type=\'Data Notebook\'\n
)\n
\n
# Return notebook for batch_mode, used in tests\n
if batch_mode:\n
return notebook\n
\n
# Add status message to be displayed after new notebook creation\n
translateString = context.Base_translateString\n
portal_status_message = translateString(\n
"New Notebook created"\n
)\n
\n
# Redirect the notebook view with the status message being displayed\n
return notebook.Base_redirect(\'view\',\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
</string> </value>
......
......@@ -50,20 +50,28 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>notebook_message = context.newContent(\n
<value> <string>"""\n
This python script concerns with creation of new notebook message which would\n
have notebook_code from jupyter frontend as well as its executed result\n
"""\n
# Create new Data Notebook Message object\n
notebook_message = context.newContent(\n
notebook_code=notebook_code,\n
notebook_code_result=notebook_code_result,\n
portal_type="Data Notebook Message"\n
)\n
\n
# Return notebook_message object for batch mode, used in tests\n
if batch_mode:\n
return notebook_message\n
\n
# Add status message to be displayed after new notebook message creation\n
translateString = context.Base_translateString\n
portal_status_message = translateString(\n
"New Notebook message created"\n
)\n
\n
# Redirect the notebook_message view with the status message being displayed\n
return notebook_message.Base_redirect(\'view\',\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
</string> </value>
......
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