From a7828d7904ac6ca8fef25cbfae2284e3cb258397 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 6 Aug 2013 08:58:21 -0500 Subject: [PATCH] fixed issue 1612, thanks gi0baro --- VERSION | 2 +- gluon/dal.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 2654ffc3..368932f6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.08.06.06.56.19 +Version 2.6.0-development+timestamp.2013.08.06.08.57.19 diff --git a/gluon/dal.py b/gluon/dal.py index 20ec8c2d..786d887c 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -5346,10 +5346,12 @@ class MongoDBAdapter(NoSQLAdapter): d = datetime.date(2000, 1, 1) # mongodb doesn't has a time object and so it must datetime, # string or integer - return datetime.datetime.combine(d, value) + return datetime.datetime.combine(d, value) elif fieldtype == "blob": from bson import Binary - return Binary(value) + if not isinstance(value, Binary): + return Binary(value) + return value elif (isinstance(fieldtype, basestring) and fieldtype.startswith('list:')): if fieldtype.startswith('list:reference'):