- changed milestone to 1.x.xx
- changed component to sql
-
assigned issue to
Support native Python 3.4 enums with enum type
Issue #3292
resolved
It would be nice to have built-in integration between the SQLAlchemy enum type and standard Python enums.
Comments (5)
-
repo owner -
repo owner some discussion at https://bitbucket.org/zzzeek/sqlalchemy/pull-request/51/builtin-enum-recipe/diff.
My current proposal is to add a minimal integration hook as:
from any_enum_package import Enum class Color(Enum): red = 1 green = 2 blue = 3 enum_type = sqlalchemy.Enum('red', 'green', 'blue', enum_obj=(Color.red, Color.green, Color.blue))
The Enum type would now deal with "Color.red", "Color.green", and "Color.blue" as the values which are expected as input as well as delivered in output.
-
repo owner - changed milestone to 1.1
-
repo owner - changed milestone to 1.x.xx
-
repo owner - changed status to resolved
- add changelog and migration notes for new Enum features,
fixes
#3095,#3292 - reorganize enum constructor to again work with the MySQL ENUM type
- add a new create_constraint flag to Enum to complement that of Boolean
- reinstate the CHECK constraint tests for enum, these already fail /skip against the MySQL backend
- simplify lookup rules in Enum, have them apply to all varieties of Enum equally
→ <<cset df55695f8e99>>
- Log in to comment
easy enough for whomever wants to PR it