X-Git-Url: http://dolda2000.com/gitweb/?p=didex.git;a=blobdiff_plain;f=didex%2Fstore.py;h=cc97a5b5ca83d7e31129a4977cd25b6c01994a27;hp=43c134873e71bfbfa8898e20ee0d82fa2a309bcc;hb=de73859d9c5ba731ad1aa13e36588b798f088656;hpb=b914d5dd0446fc9e3d296075f02264139351395b diff --git a/didex/store.py b/didex/store.py index 43c1348..cc97a5b 100644 --- a/didex/store.py +++ b/didex/store.py @@ -1,4 +1,4 @@ -import threading, pickle +import threading, pickle, inspect from . import db, index, cache from .db import txnfun @@ -35,12 +35,13 @@ class storedesc(object): def storedescs(obj): t = type(obj) - ret = getattr(t, "__didex_attr", None) + ret = t.__dict__.get("__didex_attr") if ret is None: ret = [] - for nm, val in t.__dict__.items(): - if isinstance(val, storedesc): - ret.append((nm, val)) + for st in inspect.getmro(t): + for nm, val in st.__dict__.items(): + if isinstance(val, storedesc): + ret.append((nm, val)) t.__didex_attr = ret return ret