CacheSet

A CacheSet is used to collect and maintain a series of caches. In SQLObject, there is one CacheSet per connection, and one Cache in the CacheSet for each class, since IDs are not unique across classes. It contains methods similar to Cache, but that take a cls argument.


Methods

f __format__(...) ...

default object formatter

f __subclasshook__(...) ...

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

f __sizeof__(...) ...

__sizeof__() -> int size of object in memory, in bytes

f __init__(self, *args, **kw) ...

f get(self, id, cls) ...

f put(self, id, cls, obj) ...

f finishPut(self, cls) ...

f created(self, id, cls, obj) ...

f expire(self, id, cls) ...

f clear(self, cls=None) ...

f tryGet(self, id, cls) ...

f tryGetByName(self, id, clsname) ...

f allIDs(self, cls) ...

f allSubCaches(self) ...

f allSubCachesByClassNames(self) ...

f weakrefAll(self, cls=None) ...

Move all objects in the cls (or if not given, then in all classes) to the weakref dictionary, where they can be collected.

f getAll(self, cls=None) ...

Returns all instances in the cache for the given class or all classes.

See the source for more information.