Enum field support
See original GitHub issueI’ve had a look around but can’t seem to find any reference to Peewee supporting enum
fields, other than a short mailing list thread with no outcome, and a user contributed recipe for Postgres which is untested. There are also arguments for not using enum.
All the supported Peewee databases have support for enum fields, and a quick look at the source indicates it would be trivial to add it in.
Is there any reason why enum fields have not been added yet? Would you consider accepting a PR for this?
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Support for EDM Enum Type
The EDM enumerated type is supported by the Windchill Rest Services framework. Declaring an EDM Enumerated Type. An enum type is defined in...
Read more >enum — Support for enumerations — Python 3.11.1 ...
EnumType. The type for Enum and its subclasses. · Enum. Base class for creating enumerated constants. · IntEnum. Base class for creating enumerated...
Read more >Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >How to support Enum value in Gorm - Stack Overflow
Good day guys, I am new to go and Gorm, I am building a simple web service using Postgres, I had an issue...
Read more >ENUM - MariaDB Knowledge Base
Enumeration, or string object that can have one value chosen from a list of values.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This code works good for Python 3.4+ enum for MySQL
Yet another version of the
EnumField
. This version stores the enum value asCharField
but restores the correct Enum type when reading it: