Sqlalchemy type enumeration / mapping?

how can i make an enum in sqlachemy? im using pylons if that matters. I also want to have in code to create another object, depends on the enumeration, with the same parameters, but with a different class of objects.

+2


a source to share


1 answer


SQLAlchemy 0.6 has a generic Enum

column type
, earlier versions have vendor specific types for some database drivers. And of course you can use Integer

.



Initializing the various classes based on the column value is straightforward. What you need for this particular case: unidirectional table inheritance .

+1


a source







All Articles