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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
9a8cefef
Commit
9a8cefef
authored
Jan 13, 2012
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manage bit columns
parent
4d3c1f0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+5
-0
product/ZMySQLDDA/db.py
product/ZMySQLDDA/db.py
+6
-0
No files found.
product/ZMySQLDA/db.py
View file @
9a8cefef
...
...
@@ -166,6 +166,10 @@ def int_or_long(s):
try
:
return
int
(
s
)
except
:
return
long
(
s
)
def
ord_or_None
(
s
):
if
s
is
not
None
:
return
ord
(
s
)
class
ThreadedDB
:
"""
This class is an interface to DB.
...
...
@@ -178,6 +182,7 @@ class ThreadedDB:
conv
[
FIELD_TYPE
.
DATETIME
]
=
DateTime_or_None
conv
[
FIELD_TYPE
.
DATE
]
=
DateTime_or_None
conv
[
FIELD_TYPE
.
DECIMAL
]
=
float
conv
[
FIELD_TYPE
.
BIT
]
=
ord_or_None
del
conv
[
FIELD_TYPE
.
TIME
]
def
__init__
(
self
,
connection
):
...
...
product/ZMySQLDDA/db.py
View file @
9a8cefef
...
...
@@ -164,6 +164,10 @@ def int_or_long(s):
try
:
return
int
(
s
)
except
:
return
long
(
s
)
def
ord_or_None
(
s
):
if
s
is
not
None
:
return
ord
(
s
)
class
ThreadedDeferredDB
:
"""
An experimental MySQL DA which implements deferred execution
...
...
@@ -176,6 +180,8 @@ class ThreadedDeferredDB:
conv
[
FIELD_TYPE
.
DATETIME
]
=
DateTime_or_None
conv
[
FIELD_TYPE
.
DATE
]
=
DateTime_or_None
conv
[
FIELD_TYPE
.
DECIMAL
]
=
float
conv
[
FIELD_TYPE
.
BIT
]
=
ord_or_None
del
conv
[
FIELD_TYPE
.
TIME
]
def
__init__
(
self
,
connection
):
...
...
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