def contentIsTracked(context): """ Check the whole tree until we hit INavigationRoot. When we find content that is tracked, return it. """ while hasattr(context, 'aq_parent') and not INavigationRoot.providedBy(context): if IContentIsTracked.providedBy(context): return context context = context.aq_parent return None
def isdirectlytracked(self): """ Returns True if our context is directly tracked. """ context = aq_inner(self.context) return IContentIsTracked.providedBy(context)