def __getattr__(self, name):
        "Allows getting table or view via attribute lookup or index notation."
        t = tuple(self.__data.where(ROW.name == name)('data'))
        assert len(t) < 3, 'Name is ambiguous!'
        assert len(t) > 1, 'Object was not found!'
        data = t[1][0]
        if isinstance(data, _View):
            return data.value
        return data
Allows getting table or view via attribute lookup or index notation.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py