-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
The code automatically sets the first choice as the default value: https://github.com/5monkeys/django-enumfield/blob/master/django_enumfield/db/fields.py#L16-L17
I think this behavior is misleading because if someone defines a field with no default, he expects the field to have no default assigned so that an error is raised if the field is also required.
Right now, it's impossible to have a required field (null=False
) with no default that would work as expected in the admin.
enum.EnumField(STATUSES, blank=True, null=False)
Setting default=None
obviously doesn't work as the whole code assumes there is a value.
Metadata
Metadata
Assignees
Labels
No labels