Skip to content
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

Support for MySQL Set Type (choices wont work) #973

Closed
cian-dev10 opened this issue Dec 30, 2022 · 1 comment
Closed

Support for MySQL Set Type (choices wont work) #973

cian-dev10 opened this issue Dec 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@cian-dev10
Copy link

Hey, I'm trying to find a solution how to use the MySQL SET field column type in the model of ormar.
How about adding a new field called ormar.SetField (it should inherit from enum.IntFlag). Choices wont work btw.

How about this implementation:

from enum import IntFlag

class SetFieldClass(IntFlag):
    A = 1
    B  = 2

import ormar

ormar.SetField(type_class=SetFieldClass)? 
@cian-dev10 cian-dev10 added the enhancement New feature or request label Dec 30, 2022
@collerek
Copy link
Owner

collerek commented Jan 9, 2023

There already is an Enum field type and if I recall correctly the sqlalchemy picks the corresponding underlying field type based on the dialect used.

@collerek collerek closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants