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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
wendelin
Commits
5ad4a202
Commit
5ad4a202
authored
Jul 02, 2020
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
erp5_wendelin: fix array preview for new UI and show data in reversed order
See merge request
nexedi/wendelin!48
parents
6549645f
d631b4f7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
27 deletions
+18
-27
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayRowList.py
...m/portal_skins/erp5_wendelin/DataArray_getArrayRowList.py
+16
-10
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_viewPreview/listbox.xml
...tal_skins/erp5_wendelin/DataArray_viewPreview/listbox.xml
+2
-17
No files found.
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayRowList.py
View file @
5ad4a202
...
@@ -3,10 +3,6 @@ from Products.ERP5Type.Document import newTempBase
...
@@ -3,10 +3,6 @@ from Products.ERP5Type.Document import newTempBase
if
context
.
getArray
()
is
None
:
if
context
.
getArray
()
is
None
:
return
[]
return
[]
length
=
context
.
getArrayShape
()[
0
]
if
length
==
0
:
return
[]
class
SequenceSliceMap
():
class
SequenceSliceMap
():
def
__init__
(
self
,
sequence_slice
,
usual_slice_length
,
total_length
):
def
__init__
(
self
,
sequence_slice
,
usual_slice_length
,
total_length
):
self
.
sequence_slice
=
sequence_slice
self
.
sequence_slice
=
sequence_slice
...
@@ -41,22 +37,32 @@ def createTempBase(nr, row):
...
@@ -41,22 +37,32 @@ def createTempBase(nr, row):
**
{
col
[
0
]:
str
(
getElement
(
row
,
i
))
for
i
,
col
in
column_iterator
})
**
{
col
[
0
]:
str
(
getElement
(
row
,
i
))
for
i
,
col
in
column_iterator
})
length
=
context
.
getArrayShape
()[
0
]
# never access more than 1000 lines at once
# never access more than 1000 lines at once
list_lines
=
min
(
list_lines
,
limit
,
1000
)
list_lines
=
min
(
list_lines
,
limit
,
1000
)
list_end
=
list_start
+
list_lines
if
list_end
>
length
:
if
context
.
REQUEST
.
has_key
(
"limit"
):
list_end
=
length
list_start
=
limit
[
0
]
list_start
=
list_end
-
(
list_end
%
list_lines
)
list_lines
=
limit
[
1
]
-
limit
[
0
]
orig_list_start
=
list_start
if
orig_list_start
+
list_lines
>
length
:
orig_list_start
=
length
-
length
-
(
length
%
list_lines
)
list_start
=
max
(
length
-
list_start
-
list_lines
,
0
)
if
abs
(
orig_list_start
)
<
list_lines
and
orig_list_start
!=
0
:
list_end
=
abs
(
orig_list_start
)
else
:
list_end
=
max
(
list_start
+
list_lines
,
0
)
#list_end = max(list_start + list_lines, 0)
if
list_start
==
list_end
:
if
list_start
==
list_end
:
array_slice
=
[
context
.
getArrayIndex
(
list_start
)]
array_slice
=
[
context
.
getArrayIndex
(
list_start
)]
else
:
else
:
array_slice
=
context
.
getArraySlice
(
list_start
,
list_end
)
array_slice
=
context
.
getArraySlice
(
list_start
,
list_end
)
temp_base_list
=
[
createTempBase
(
nr
+
list_start
,
row
)
for
nr
,
row
in
enumerate
(
array_slice
)]
temp_base_list
=
list
(
reversed
([
createTempBase
(
nr
+
list_start
,
row
)
for
nr
,
row
in
enumerate
(
array_slice
)]))
# return lazy sequence of temp objects
# return lazy sequence of temp objects
return
SequenceSliceMap
(
temp_base_list
,
list_lines
,
length
)
return
SequenceSliceMap
(
temp_base_list
,
list_lines
,
length
)
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_viewPreview/listbox.xml
View file @
5ad4a202
...
@@ -95,9 +95,7 @@
...
@@ -95,9 +95,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
url_columns
</string>
</key>
<key>
<string>
url_columns
</string>
</key>
<value>
<value>
<string></string>
</value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</item>
</dictionary>
</dictionary>
</value>
</value>
...
@@ -136,7 +134,7 @@
...
@@ -136,7 +134,7 @@
<item>
<item>
<key>
<string>
list_method
</string>
</key>
<key>
<string>
list_method
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
U
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -186,19 +184,6 @@
...
@@ -186,19 +184,6 @@
</pickle>
</pickle>
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(col[0], None) for col in here.DataArray_getArrayColumnList()]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<pickle>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
</pickle>
</pickle>
...
...
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