Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
wendelin
Commits
0c1b4673
Commit
0c1b4673
authored
Jul 23, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Option to redefine column names in data array
parent
0da07b5f
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
360 additions
and
11 deletions
+360
-11
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayLine.py
...lateItem/portal_components/document.erp5.DataArrayLine.py
+20
-7
bt5/erp5_wendelin/PropertySheetTemplateItem/portal_property_sheets/DataArrayLine/dtype_expression_property.xml
...operty_sheets/DataArrayLine/dtype_expression_property.xml
+1
-1
bt5/erp5_wendelin/PropertySheetTemplateItem/portal_property_sheets/DataArrayLine/name_property.xml
...em/portal_property_sheets/DataArrayLine/name_property.xml
+36
-0
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view.xml
...ateItem/portal_skins/erp5_wendelin/DataArrayLine_view.xml
+2
-1
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view/my_dtype_expression.xml
.../erp5_wendelin/DataArrayLine_view/my_dtype_expression.xml
+2
-2
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view/my_name_list.xml
...l_skins/erp5_wendelin/DataArrayLine_view/my_name_list.xml
+299
-0
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayLine.py
View file @
0c1b4673
...
...
@@ -26,6 +26,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
numpy
as
np
from
Products.ERP5Type.Base
import
TempBase
from
erp5.component.document.DataArray
import
DataArray
from
Products.ERP5Type.Utils
import
createExpressionContext
,
\
...
...
@@ -51,14 +52,26 @@ class DataArrayLine(DataArray):
Get numpy view of Parent Data Array according to index.
"""
getindex
=
GetIndex
(
"getindex"
)
expression_context
=
createExpressionContext
(
None
,
portal
=
getindex
)
index
=
evaluateExpressionFromString
(
expression_context
,
createExpressionContext
(
None
,
portal
=
getindex
)
,
"python: portal[%s]"
%
self
.
getIndexExpression
()
)
array_view
=
self
.
getParentValue
().
getArray
()[
index
]
dtype
=
self
.
getDtype
()
if
dtype
is
not
None
:
return
array_view
.
view
(
dtype
=
dtype
)
zbigarray
=
self
.
getParentValue
().
getArray
()
try
:
array_view
=
zbigarray
[
index
]
except
TypeError
:
array
=
zbigarray
[:]
new_dtype
=
np
.
dtype
({
name
:
array
.
dtype
.
fields
[
name
]
for
name
in
index
})
array_view
=
np
.
ndarray
(
array
.
shape
,
new_dtype
,
array
,
0
,
array
.
strides
)
name_list
=
self
.
getNameList
()
dtype_expression
=
self
.
getDtypeExpression
()
if
dtype_expression
is
not
None
or
name_list
:
if
dtype_expression
is
None
:
dtype
=
np
.
dtype
(
array_view
.
dtype
)
else
:
dtype
=
evaluateExpressionFromString
(
createExpressionContext
(
None
,
portal
=
getindex
),
dtype_expression
)
dtype
.
names
=
name_list
return
array_view
.
view
(
dtype
=
dtype
)
return
array_view
bt5/erp5_wendelin/PropertySheetTemplateItem/portal_property_sheets/DataArrayLine/dtype_property.xml
→
bt5/erp5_wendelin/PropertySheetTemplateItem/portal_property_sheets/DataArrayLine/dtype_
expression_
property.xml
View file @
0c1b4673
...
...
@@ -22,7 +22,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
dtype_property
</string>
</value>
<value>
<string>
dtype_
expression_
property
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
bt5/erp5_wendelin/PropertySheetTemplateItem/portal_property_sheets/DataArrayLine/name_property.xml
0 → 100644
View file @
0c1b4673
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
List of filends name of array dtype
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
name_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view.xml
View file @
0c1b4673
...
...
@@ -75,7 +75,6 @@
<value>
<list>
<string>
my_reference
</string>
<string>
my_dtype
</string>
</list>
</value>
</item>
...
...
@@ -84,6 +83,8 @@
<value>
<list>
<string>
my_index_expression
</string>
<string>
my_dtype_expression
</string>
<string>
my_name_list
</string>
</list>
</value>
</item>
...
...
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view/my_dtype.xml
→
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view/my_dtype
_expression
.xml
View file @
0c1b4673
...
...
@@ -17,7 +17,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_dtype
</string>
</value>
<value>
<string>
my_dtype
_expression
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
@@ -78,7 +78,7 @@
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_
string_field
</string>
</value>
<value>
<string>
my_
view_mode_tales_expression
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
...
...
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArrayLine_view/my_name_list.xml
0 → 100644
View file @
0c1b4673
This diff is collapsed.
Click to expand it.
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