fix: tweak KeyError message for ModelBase
This commit is contained in:
parent
db104aeefb
commit
7a5d0b8e67
1 changed files with 3 additions and 1 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue