diff --git a/tortoise/models.py b/tortoise/models.py index b7d709615..6371a0568 100644 --- a/tortoise/models.py +++ b/tortoise/models.py @@ -745,7 +745,8 @@ def _init_from_db(cls: Type[MODEL], **kwargs: Any) -> MODEL: self._partial = True # TODO: Apply similar perf optimisation as above for partial for key, value in kwargs.items(): - setattr(self, key, meta.fields_map[key].to_python_value(value)) + if hasattr(self, key): + setattr(self, key, meta.fields_map[key].to_python_value(value)) return self