fix: fixed issue with new mixin

This commit is contained in:
2025-01-24 19:04:07 +01:00
parent eb62c87679
commit ecfc0fc167

View File

@@ -1,4 +1,5 @@
from sqlalchemy import Column from sqlalchemy import Column
from sqlalchemy.orm import Mapped
class AutoAnnotateMixin: class AutoAnnotateMixin:
@@ -8,7 +9,7 @@ class AutoAnnotateMixin:
annotations = {} annotations = {}
for key, value in cls.__dict__.items(): for key, value in cls.__dict__.items():
if isinstance(value, Column): if isinstance(value, Column):
annotations[key] = value.type.python_type annotations[key] = Mapped[value.type.python_type]
cls.__annotations__ = annotations cls.__annotations__ = annotations