def __getattribute__(self, name): try: attr = SimpleItem.__getattribute__(self, 'data').get(name, EMPTY_MARKER) if attr is not EMPTY_MARKER: return attr except AttributeError, e: pass
class Record(SimpleItem): implements(IRecord) def __init__(self, **kw): self.id = uuid.uuid4().hex self.intid = None self.data = OOBTree() for key in kw.keys(): self.data[key] = kw[key] self._p_changed = True def __getattribute__(self, name): try: attr = SimpleItem.__getattribute__(self, 'data').get(name, EMPTY_MARKER) if attr is not EMPTY_MARKER: return attr except AttributeError, e: pass return SimpleItem.__getattribute__(self, name)