Cédric,
Fyi, I've been busy testing today, and I haven't had a single
ConcurrencyException since applying below changeset +
http://codereview.appspot.com/2363044/
where the latter was also applied to the proteus code, just to make sure.
thanks!
On 10/08/2010 10:36 AM, "Cédric Krier" <[email protected]>" wrote:
Please review this at http://codereview.appspot.com/2332044/
Affected files:
M trytond/model/modelsql.py
Index: trytond/model/modelsql.py
===================================================================
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -4,6 +4,7 @@
import contextlib
import datetime
import re
+from decimal import Decimal
from trytond.model import ModelStorage
from trytond.model import fields
from trytond.backend import FIELDS, TableHandler
@@ -489,10 +490,9 @@
if '_timestamp' in fields_pre:
if not self.table_query():
fields_pre2 += ['CAST(EXTRACT(EPOCH FROM '
- '(COALESCE("%s".write_date,
"%s".create_date))) AS %s'
- ') AS _timestamp' %
- (self._table, self._table,
-
FIELDS['numeric'].sql_type(self.create_date)[1])]
+ '(COALESCE("%s".write_date, "%s".create_date)))'
+ 'AS VARCHAR) AS _timestamp' %
+ (self._table, self._table)]
for i in range(0, len(ids), in_max):
sub_ids = ids[i:i + in_max]
@@ -749,8 +749,8 @@
for i in sub_ids:
if Transaction().timestamp.get(self._name + ',' +
str(i)):
args.append(i)
- args.append(Transaction().timestamp[
- self._name + ',' +str(i)])
+ args.append(Decimal(Transaction().timestamp[
+ self._name + ',' +str(i)]))
if args:
cursor.execute("SELECT id " \
'FROM "' + self._table + '" ' \
@@ -1184,8 +1184,7 @@
if not self.table_query():
select_fields += ['CAST(EXTRACT(EPOCH FROM '
'(COALESCE("' + self._table + '".write_date, '
- '"' + self._table + '".create_date))) AS ' + \
- FIELDS['numeric'].sql_type(self.create_date)[1] + \
+ '"' + self._table + '".create_date))) AS VARCHAR'
') AS _timestamp']
query_str = cursor.limit_clause(
'SELECT ' + ','.join(select_fields) + ' FROM ' + \
--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
--
[email protected] mailing list