diff --git a/VERSION b/VERSION index 29bbc971..916dfd8f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.01.12.14.03.31 +Version 2.4.1-alpha.2+timestamp.2013.01.12.14.08.26 diff --git a/gluon/dal.py b/gluon/dal.py index 3b001bb8..0d7ecfef 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -6689,28 +6689,22 @@ class Row(object): del d[k] return d - def as_json(self, mode='object', default=None, **kwargs): + def as_json(self, default=None, **kwargs): """ serializes the table to a JSON list of objects - kwargs are passed to .as_dict method + only "object" mode supported + TODO: return array mode with query column order """ - mode = mode.lower() - if not mode in ['object', 'array']: - raise SyntaxError('Invalid JSON serialization mode: %s' % mode) - multi = any([isinstance(v, self.__class__) for v in self.values()]) item = dict() if multi: - for k, v in self.as_dict(**kwargs).iteritems(): + for v in self.as_dict(**kwargs).values(): item.update(v) else: item = self.as_dict(**kwargs) - if mode != 'object': - item = item.values() - if have_serializers: return serializers.json(item, default=default or