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
e0388ecc
Commit
e0388ecc
authored
May 25, 2015
by
Julien Muchembled
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catalog: render µs in SQL methods
parent
c3215b74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
product/ERP5Type/patches/sqlvar.py
product/ERP5Type/patches/sqlvar.py
+4
-6
No files found.
product/ERP5Type/patches/sqlvar.py
View file @
e0388ecc
...
@@ -72,17 +72,15 @@ def SQLVar_render(self, md):
...
@@ -72,17 +72,15 @@ def SQLVar_render(self, md):
'Invalid datetime value for <em>%s</em>: %r'
%
(
name
,
v
))
'Invalid datetime value for <em>%s</em>: %r'
%
(
name
,
v
))
try
:
try
:
if
getattr
(
v
,
'ISO'
,
None
)
is
not
None
:
v
=
(
v
if
isinstance
(
v
,
DateTime
)
else
DateTime
(
v
)).
toZone
(
'UTC'
)
v
=
v
.
toZone
(
'UTC'
).
ISO
()
# For subsecond precision in MySQL, use 'datetime(N)' type,
else
:
# where N is the number of digits after the decimal point.
v
=
DateTime
(
v
)
v
=
"'%s.%06u'"
%
(
v
.
ISO
(),
v
.
micros
()
%
1000000
)
v
=
v
.
toZone
(
'UTC'
).
ISO
()
except
:
except
:
if
not
v
and
args
.
has_key
(
'optional'
)
and
args
[
'optional'
]:
if
not
v
and
args
.
has_key
(
'optional'
)
and
args
[
'optional'
]:
return
'null'
return
'null'
raise
ValueError
,
(
raise
ValueError
,
(
'Invalid datetime value for <em>%s</em>: %r'
%
(
name
,
v
))
'Invalid datetime value for <em>%s</em>: %r'
%
(
name
,
v
))
v
=
md
.
getitem
(
'sql_quote__'
,
0
)(
v
)
# End of patch
# End of patch
else
:
else
:
# Patched by yo
# Patched by yo
...
...
Vivek
@vivek.pabani
mentioned in commit
7a5a0667
·
Jun 11, 2015
mentioned in commit
7a5a0667
mentioned in commit 7a5a0667a6fe32e8a6d55db66836fdf3cfe719b2
Toggle commit list
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