From f8f91c6a6abbdbc47d103816c26d48fb94f3fad8 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 17 Nov 2013 12:03:20 -0600 Subject: [PATCH] experiment with mongodb and belongs --- VERSION | 2 +- gluon/dal.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1d9c9cd2..59dfe220 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.7.4-stable+timestamp.2013.11.17.09.31.13 +Version 2.7.4-stable+timestamp.2013.11.17.12.02.33 diff --git a/gluon/dal.py b/gluon/dal.py index 80897379..79462425 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -5578,6 +5578,9 @@ class MongoDBAdapter(NoSQLAdapter): value = obj else: value = NoSQLAdapter.represent(self, obj, fieldtype) + if isinstance(obj, (list, tuple)) and \ + (not fieldtype == "json" or fieldtype.startswith('list:')): + return value # reference types must be convert to ObjectID if fieldtype =='date': if value == None: