From 9e4930243cd9bd550f7ec846e1c06df99962d961 Mon Sep 17 00:00:00 2001 From: Massimo DiPierro Date: Tue, 28 Feb 2012 10:57:23 -0600 Subject: [PATCH] blob_decode bug fix, issue 657, thanks hi21alt --- VERSION | 2 +- gluon/dal.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 346c410b..7dbf77e6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2012-02-28 10:47:48) stable +Version 1.99.4 (2012-02-28 10:57:21) stable diff --git a/gluon/dal.py b/gluon/dal.py index f3b8b825..57680f10 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1487,6 +1487,8 @@ class BaseAdapter(ConnectionPool): return value elif field_type in ('string', 'text', 'password', 'upload'): return value + elif field_type == 'blob' and not blob_decode: + return value else: key = regex_type.match(field_type).group(0) return self.parsemap[key](value,field_type) @@ -1592,8 +1594,10 @@ class BaseAdapter(ConnectionPool): if not regex_table_field.match(colnames[j]): if not '_extra' in new_row: new_row['_extra'] = Row() - new_row['_extra'][colnames[j]] = self.parse_value(value, fields[j].type) - new_column_name = regex_select_as_parser.search(colnames[j]) + new_row['_extra'][colnames[j]] = \ + self.parse_value(value, fields[j].type,blob_decode) + new_column_name = \ + regex_select_as_parser.search(colnames[j]) if not new_column_name is None: column_name = new_column_name.groups(0) setattr(new_row,column_name[0],value) @@ -1607,7 +1611,8 @@ class BaseAdapter(ConnectionPool): virtualtables.append(tablename) else: colset = new_row[tablename] - colset[fieldname] = value = self.parse_value(value,field.type) + colset[fieldname] = value = \ + self.parse_value(value,field.type,blob_decode) if field.type == 'id': id = value