Commit 141ae33d by Vincent Pelletier

Extract the code to split up trans.oids column into a oid list.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1935 71dcc9de-d417-0410-9af5-da40c76e7ee4
1 parent 3d13e593
......@@ -29,6 +29,15 @@ from neo import util
LOG_QUERIES = False
def splitOIDField(tid, oids):
if (len(oids) % 8) != 0 or len(oids) == 0:
raise DatabaseFailure('invalid oids for tid %x' % tid)
oid_list = []
append = oid_list.append
for i in xrange(0, len(oids), 8):
append(oids[i:i+8])
return oid_list
class MySQLDatabaseManager(DatabaseManager):
"""This class manages a database on MySQL."""
......@@ -425,11 +434,7 @@ class MySQLDatabaseManager(DatabaseManager):
self.commit()
if r:
oids, user, desc, ext, packed = r[0]
if (len(oids) % 8) != 0 or len(oids) == 0:
raise DatabaseFailure('invalid oids for tid %x' % tid)
oid_list = []
for i in xrange(0, len(oids), 8):
oid_list.append(oids[i:i+8])
oid_list = splitOIDField(tid, oids)
return oid_list, user, desc, ext, bool(packed)
return None
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!