there are two problems: you are creating the instance before you cache, so the caching does nothing (would do nothing if it worked). It does not work because it cannot be serialized since Blah is not defined in a module but in a model/controller. You will avoid lots of headaches if you cache dictionaries instead of objects.
On Nov 14, 4:36 pm, Michael Toomim <[email protected]> wrote: > Hi all, it appears I can't use any of my own classes in the cache: > > class Blah: > pass > > b = blah() > cache.disk('blah', lambda: b) > > This results in: > > AttributeError: 'module' object has no attribute 'Blah' > > I think this is because the things I'm defining (e.g. in models/) > isn't accessible from cache.py in gluon/. Is there a way around this?

