-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
Would be nice to add an option to serialize enum name instead of value.
I use such objects:
class FrequencyChoices(Enum):
monthly = relativedelta.relativedelta(months=1)
quarterly = relativedelta.relativedelta(months=3)The values are not serializable so I need to serialize the name instead. Maybe the best would just be to rename the option ints_as_names and do not constraint its usage to enums storing int values. I can think about other applications where it could be preferable to serialize the name, even if the value is also serializable:
class CurrencyChoices(Enum):
euro = "€"
us_dollar = "$"Reactions are currently unavailable