def lineage(item): while item is not None: yield item try: item = item.__parent__ except AttributeError: # We try an adaptation. If it fails, this time, we let it # bubble up. item = ILocation(item) item = item.__parent__
def get_name(context): """Get context name""" return ILocation(context).__name__