Allows expected behavior when cast to str, also matching behaviour of
created instances with those fetched from the DB.
Thanks to Simon Charette, Nick Pope, and Shai Berger for reviews.
Backport of dbcd7b064e from master
These classes can serve as a base class for user enums, supporting
translatable human-readable names, or names automatically inferred
from the enum member name.
Additional properties make it easy to access the list of names, values
and display labels.
Thanks to the following for ideas and reviews:
Carlton Gibson, Fran Hrženjak, Ian Foote, Mariusz Felisiak, Shai Berger.
Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>