From 7898e4aac37b75ce96ca9119a3ac9d9ceb8a0d4a Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 20 Aug 2012 12:04:55 -0500 Subject: [PATCH] Storage.__class__ = dict tricks isinstance --- VERSION | 2 +- gluon/storage.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 828c58cc..0e4e09a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-20 11:57:27) dev +Version 2.00.0 (2012-08-20 12:04:52) dev diff --git a/gluon/storage.py b/gluon/storage.py index 755ceb8e..f556f1a1 100644 --- a/gluon/storage.py +++ b/gluon/storage.py @@ -51,7 +51,7 @@ class List(list): return value class Storage(object): - + __class__ = dict """ A Storage object is like a dictionary except `obj.foo` can be used in addition to `obj['foo']`, and setting obj.foo = None deletes item foo. @@ -100,6 +100,8 @@ class Storage(object): return self.__dict__.values() def items(self): return self.__dict__.items() + def len(self): + return len(self.__dict__) def __iter__(self): return self.__dict__.__iter__() def has_key(self,key):