-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Enum fields made with django-enumfields serialize incorrectly as __repr__-like strings.
Model
import enumfields
class Action(enumfields.Enum):
LIST = 'list'
class Permission(models.model):
action = enumfields.EnumField(Action, max_length=30)manage.py dumpscript output (incorrect)
app_permission_1 = UserCategoryPermission()
app_permission_1.action = <Action.LIST: 'list'>yaml manage.py dumpdata output (correct)
- model: app.permission
pk: 1
fields:
action: list