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
Jérome Perrin
wendelin
Commits
d631b4f7
Commit
d631b4f7
authored
Jul 02, 2020
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin: fix array preview for new UI and show data in reversed order
parent
98c8e221
Changes
2
Hide 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 @
d631b4f7
...
...
@@ -2,10 +2,6 @@ from Products.ERP5Type.Document import newTempBase
if
context
.
getArray
()
is
None
:
return
[]
length
=
context
.
getArrayShape
()[
0
]
if
length
==
0
:
return
[]
class
SequenceSliceMap
():
def
__init__
(
self
,
sequence_slice
,
usual_slice_length
,
total_length
):
...
...
@@ -41,22 +37,32 @@ def createTempBase(nr, row):
**
{
col
[
0
]:
str
(
getElement
(
row
,
i
))
for
i
,
col
in
column_iterator
})
length
=
context
.
getArrayShape
()[
0
]
# never access more than 1000 lines at once
list_lines
=
min
(
list_lines
,
limit
,
1000
)
list_end
=
list_start
+
list_lines
if
list_end
>
length
:
list_end
=
length
list_start
=
list_end
-
(
list_end
%
list_lines
)
if
context
.
REQUEST
.
has_key
(
"limit"
):
list_start
=
limit
[
0
]
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
:
array_slice
=
[
context
.
getArrayIndex
(
list_start
)]
else
:
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
SequenceSliceMap
(
temp_base_list
,
list_lines
,
length
)
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_viewPreview/listbox.xml
View file @
d631b4f7
...
...
@@ -95,9 +95,7 @@
</item>
<item>
<key>
<string>
url_columns
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
...
...
@@ -136,7 +134,7 @@
<item>
<key>
<string>
list_method
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
U
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
<item>
...
...
@@ -186,19 +184,6 @@
</pickle>
</record>
<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>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
</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