Skip to content

MySQL Enum reflection convertion issue #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sebastiandev opened this issue Jul 24, 2018 · 0 comments
Open

MySQL Enum reflection convertion issue #148

sebastiandev opened this issue Jul 24, 2018 · 0 comments

Comments

@sebastiandev
Copy link

When using reflection to build the models (instead of declarative) the Enum conversion fails because the ENUM column is treated as string so doing type.name returns None.

CREATE TABLE `foos` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` ENUM('open', 'closed') DEFAULT 'open',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
class Foo(Base):

    __table__ = Table('foos', metadata, autoload=True)
enum_class = super(EnumMeta, metacls).__new__(metacls, cls, bases, classdict) TypeError: Error when calling the metaclass bases     type() argument 1 must be string, not None

Suggested fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant