From 206cebc6deb50848cb17e3bb3c1764e0a628e345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danii=C5=82=20M?= <37304160+danoctua@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:28:52 +0100 Subject: [PATCH] Add support to fields implementing the field of specific size --- mixer/backend/sqlalchemy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mixer/backend/sqlalchemy.py b/mixer/backend/sqlalchemy.py index 4ad4e4c0..8ff0fd1d 100644 --- a/mixer/backend/sqlalchemy.py +++ b/mixer/backend/sqlalchemy.py @@ -222,6 +222,12 @@ def make_fabric(self, column, field_name=None, fake=False, kwargs=None): # noqa # don't directly inherit from the base types if TypeDecorator in ftype.__bases__: ftype = ftype.impl + # In SQLAlchemy within the TypeDecorator class in SQLAlchemy, + # the impl attribute is meant to reference a SQLAlchemy TypeEngine class + # or a pre-configured instance of such a class that corresponds with the database column type to be used. + # The TypeDecorator then extends or modifies the behavior of this type. + if not inspect.isclass(ftype): + ftype = type(ftype) stype = self.__factory.cls_to_simple(ftype)