Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
42c66041
Commit
42c66041
authored
Sep 28, 2018
by
Pierre Dittgen
Browse files
Stringify cell value to resolve Excel issue
parent
00610080
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui_next/views.py
View file @
42c66041
...
...
@@ -18,6 +18,13 @@ import tabulator
def
extract_source_data
(
source
,
preview_rows_nb
=
5
):
""" Computes table preview """
def
stringify
(
val
):
""" Transform value into string """
if
val
is
None
:
return
''
return
str
(
val
)
header
=
None
rows
=
[]
nb_rows
=
0
...
...
@@ -26,7 +33,7 @@ def extract_source_data(source, preview_rows_nb=5):
if
header
is
None
:
header
=
row
else
:
rows
.
append
(
row
)
rows
.
append
(
list
(
map
(
stringify
,
row
)
))
nb_rows
+=
1
return
{
'header'
:
header
,
'data_rows'
:
rows
,
...
...
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