Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0f361067
Commit
0f361067
authored
Oct 06, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_data_notebook bt5: Add comments in python scripts from portal_skin for this bt5
parent
bb3fe819
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
...erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
+15
-1
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
...rp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
+9
-1
No files found.
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
View file @
0f361067
...
...
@@ -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>
...
...
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
View file @
0f361067
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment