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
139
Merge Requests
139
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
74aea681
Commit
74aea681
authored
Mar 31, 2021
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sqltest patch
parent
84b88b87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
product/ERP5Type/patches/sqltest.py
product/ERP5Type/patches/sqltest.py
+10
-3
No files found.
product/ERP5Type/patches/sqltest.py
View file @
74aea681
...
...
@@ -51,7 +51,7 @@ if 1: # For easy diff with original
if
type
(
v
)
is
StringType
:
if
v
[
-
1
:]
==
'L'
:
v
=
v
[:
-
1
]
atoi
(
v
)
int
(
v
)
else
:
v
=
str
(
int
(
v
))
except
ValueError
:
raise
ValueError
,
(
...
...
@@ -59,7 +59,7 @@ if 1: # For easy diff with original
elif
t
==
'float'
:
if
not
v
and
type
(
v
)
is
StringType
:
continue
try
:
if
type
(
v
)
is
StringType
:
atof
(
v
)
if
type
(
v
)
is
StringType
:
float
(
v
)
else
:
v
=
str
(
float
(
v
))
except
ValueError
:
raise
ValueError
,
(
...
...
@@ -105,4 +105,11 @@ if 1: # For easy diff with original
return
"%s %s %s"
%
(
self
.
column
,
self
.
op
,
vs
[
0
])
SQLTest
.
render
=
SQLTest
.
__call__
=
render
sqltest
.
valid_type
=
((
'int'
,
'float'
,
'string'
,
'nb'
,
'datetime'
)
+
tuple
(
'datetime(%s)'
%
x
for
x
in
xrange
(
7
))).
__contains__
new_valid_types
=
((
'int'
,
'float'
,
'string'
,
'nb'
,
'datetime'
)
+
tuple
(
'datetime(%s)'
%
x
for
x
in
xrange
(
7
)))
try
:
# BBB
from
Shared.DC.ZRDB.sqltest
import
valid_type
sqltest
.
valid_type
=
new_valid_types
.
__contains__
except
ImportError
:
sqltest
.
valid_types
=
new_valid_types
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