Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New stable release #57

Closed
ca-simone-chiorazzo opened this issue Nov 21, 2019 · 6 comments
Closed

New stable release #57

ca-simone-chiorazzo opened this issue Nov 21, 2019 · 6 comments

Comments

@ca-simone-chiorazzo
Copy link

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?

@Swamii
Copy link
Contributor

Swamii commented Nov 22, 2019

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?

@ca-simone-chiorazzo
Copy link
Author

@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.

@Swamii
Copy link
Contributor

Swamii commented Nov 22, 2019

@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.

@ca-simone-chiorazzo
Copy link
Author

@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.

@Swamii
Copy link
Contributor

Swamii commented Nov 22, 2019

@ca-simone-chiorazzo If you want to stay on 1.x then perhaps this works? #25 (comment)

@Swamii
Copy link
Contributor

Swamii commented Dec 12, 2019

@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.

@Swamii Swamii closed this as completed Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants