mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-12 19:30:30 +02:00
fix: fixed issue with new mixin
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user