summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2008-12-10 15:29:55 +0100
committerChristophe Simonis <christophe@tinyerp.com>2008-12-10 15:29:55 +0100
commit1a0de2f0f97f247d62a3fff8516781618f7ea9f4 (patch)
tree85bfb2ef7d25efd94cf30162148b5a0e8131a0e7 /addons/document/document.py
parent5bf1b8d2855666ea607f32dea4df15d6a1ea462e (diff)
[FIX] psycopg2: %d -> %s
bzr revid: christophe@tinyerp.com-20081210142955-ewfr1qhzq9l1tjzn
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index e7929f2ba90..afb466c983a 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -35,7 +35,7 @@ import StringIO
import random
import string
-
+from psycopg2 import Binary
from tools import config
def random_name():
@@ -522,9 +522,9 @@ class document_file(osv.osv):
v = base64.decodestring(value)
fp.write(v)
filesize = os.stat(fname).st_size
- cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%d where id=%d', (os.path.join(flag,filename),'fs',len(v),id))
+ cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id))
else:
- cr.execute('update ir_attachment set datas=%s,store_method=%s where id=%d', (psycopg.Binary(value),'db',id))
+ cr.execute('update ir_attachment set datas=%s,store_method=%s where id=%s', (Binary(value),'db',id))
return True
_columns = {