I'm trying to create a model to describe a table with an enum field in peewee.
I'm seeing that EnumField was removed from the peewee.py file before the 2.0 version, and I can't find anything in the current docs that outlines how to implement it. Does anyone know if I can just use CharField?
Here is a working solution for PostgreSQL:
https://gist.github.com/b1naryth1ef/607e92dc8c1748a06b5d
there was not an EnumField prior to 2.0, but there are docs on implementing a custom field: http://peewee.readthedocs.org/en/latest/peewee/models.html#creating-a-custom-field
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With