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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
e0388ecc
Commit
e0388ecc
authored
May 25, 2015
by
Julien Muchembled
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
...
...
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