3
0
Fork 0

fix: tweak KeyError message for ModelBase

This commit is contained in:
Lance Edgar 2026-01-02 19:00:42 -06:00
parent db104aeefb
commit 7a5d0b8e67

View file

@ -65,7 +65,9 @@ class ModelBase: # pylint: disable=empty-docstring
state = sa.inspect(self) state = sa.inspect(self)
if hasattr(state.attrs, key): if hasattr(state.attrs, key):
return getattr(self, key) return getattr(self, key)
raise KeyError(f"model instance has no attr with key: {key}") raise KeyError(
f"{self.__class__.__name__} instance has no attr with key: {key}"
)
class UUID( class UUID(