Skip to content

Conversation

mx-moth
Copy link

@mx-moth mx-moth commented Jan 21, 2020

Enum columns are excellent, supporting them natively in the forms makes them very nice to work with.

@mx-moth mx-moth mentioned this pull request Jan 21, 2020
@mx-moth
Copy link
Author

mx-moth commented Jan 22, 2020

This one requires a more recent sqlalchemy version, which is not explicitly mentioned in the tests. It works with more recent versions. What are your thoughts on dropping support for very old sqlalchemy versions?

@mlenzen
Copy link
Owner

mlenzen commented Feb 6, 2020

Yeah, I'm good dropping support for very old versions, the last 0.9.x release was in 2015. Do you know what version of SQLAlchemy is required for this PR? I was also thinking Python 2 support should be dropped. Maybe I'll make one last release that supports old Python and old SQLAlchemy

@mx-moth
Copy link
Author

mx-moth commented Feb 6, 2020

sqlalchemy>=1.1 is required, as that is when the Enum column class first supported Python native Enums. The code as written also requires Python 3.

I could modify the code such that it supports sqlalchemy < 1.1, by doing something like if getattr(column, 'enum_class', None) is not None: instead of if column.enum_class:? Sadly I can't test based on the sqlalchemy version easily, as sqlalchemy does not expose the version information in a convenient tuple form, only as a string.

@mx-moth
Copy link
Author

mx-moth commented Feb 7, 2020

Superseded by #13, which includes tests, an EnumSelectMultipleField, and no merge conflicts!

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

Successfully merging this pull request may close these issues.

2 participants