Closed ca-simone-chiorazzo closed 4 years ago
We are about to release 2.0 final. Please note that 2.0 has multiple breaking changes, so it requires multiple changes to your code (as outlined here).
Not sure I follow your issue though. Doesn't EnumField(Enum, default=None)
work as a way to require the field to be set?
@Swamii Ok, thanks for the info. We gonna wait for the 2.0 release.
Unfortunately, that workaround does not work because Django tries to insert the record with NULL on the DB but the field does not accept null values and goes in IntegrityError.
@ca-simone-chiorazzo OK, so there's a different error if default is not provided? I cannot recall.
Either way, we just released 2.0 final. See if it works for you.
@Swamii Yes, the error, when you don't provide the default, is that the EnumField define internally a default using the first value of the Enum and so is impossible make it mandatory.
@ca-simone-chiorazzo If you want to stay on 1.x then perhaps this works? https://github.com/5monkeys/django-enumfield/issues/25#issuecomment-150467741
@ca-simone-chiorazzo I'm gonna go ahead and close this, since we have released 2.0 and the conversation died down here. Feel free to reopen if needed.
We are encountering problems with the fact that the EnumField in version 1.5 dot not allow mandatory field because it set by default based on the default of Enum.
We also noticed that you have already fixed it in the latest beta release.
What's is blocking the new stable release?