-
Notifications
You must be signed in to change notification settings - Fork 46
#15 Use enum34 class #26
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
Conversation
54582fc
to
d6eaca7
Compare
Wow! Thank you. So sorry for the late response, I've been on a vacation. Will have a look at this tomorrow. |
@fcurella I have created PR fcurella#1 to fix issues with labels and migrations. Please have a look |
Thanks @andreif, I'm out for the weekend, I'll take a look on Monday |
Fix labels and migrations
@andreif the changes are simple enough, I've just merged your PR. Thanks again :) |
👍 There are still some issues, which I will hopefully look at during the weekend or on Monday. |
enum instead of int in field value; raise validation error when enum is not found by value or name (and support digit str), etc WARNING: Inconsistent field value atm -- enum for Django 1.8 and int for other versions when model is initialized
@fcurella I've made some changes in fcurella#2 but they may be somewhat controversial. There is still an unresolved issue with inconsistent field value. |
different Django versions
…enum34 subclass IntEnum instead of Enum
Change labels and transitions attr name, etc
Hey @fcurella, please have a look at fcurella#3 |
For those looking for a simple solution to use IntEnum in choices and validate against it automatically: https://github.com/hearthsim/django-intenumfield |
Has this been tested with Django 1.10? Seems like this would be a good time to make it work and merge. Hitting a 1.10 bug with 1.3b2 but have not had time to reproduce it yet... |
Hi, is there any update on this. I just updated to 1.11 and seem like non of the EnumField update itself anymore, even if we call 'save' on the model ? |
@nathando I've just tested this branch against Django 1.11 and all of the tests have passed. Do you have a test case reproducing the problem you are experiencing? |
@kjagiello Hi, i've found out that it is this issue #39 and currently apply the hot fix which was posted there. The problem is Django 1.10+ consider enumfields deferred. |
@kjagiello thank you! Hope some one review and merge it soon to release. Otherwise, other ppl will hit the same issue. |
Hope someone reviews this pull request soon and merges it for native |
Works fine for Django 1.11.15. Thanks a lot. |
Hey! |
Ref #15
Most tests are passing, but I had to drop some existing features:
Enum
, thereforeself.assertTrue(isinstance(person.status, int))
failsEnum.label()
method conflicts with the members'label
property, so I had to pick one. I've picked theproperty