Skip to content

Conversation

fcurella
Copy link
Contributor

Ref #15

Most tests are passing, but I had to drop some existing features:

  • The value of the field is an Enum, therefore self.assertTrue(isinstance(person.status, int)) fails
  • The custom Enum.label() method conflicts with the members' label property, so I had to pick one. I've picked the property

@fcurella fcurella force-pushed the enum34 branch 14 times, most recently from 54582fc to d6eaca7 Compare September 14, 2015 20:56
@hannseman
Copy link
Contributor

Wow! Thank you. So sorry for the late response, I've been on a vacation. Will have a look at this tomorrow.

@andreif
Copy link
Contributor

andreif commented Oct 16, 2015

@fcurella I have created PR fcurella#1 to fix issues with labels and migrations. Please have a look

@fcurella
Copy link
Contributor Author

Thanks @andreif,

I'm out for the weekend, I'll take a look on Monday

@fcurella
Copy link
Contributor Author

@andreif the changes are simple enough, I've just merged your PR.

Thanks again :)

@andreif
Copy link
Contributor

andreif commented Oct 17, 2015

👍

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
@andreif
Copy link
Contributor

andreif commented Oct 19, 2015

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

@andreif
Copy link
Contributor

andreif commented Nov 16, 2015

Hey @fcurella, please have a look at fcurella#3

@jleclanche
Copy link

jleclanche commented May 23, 2016

For those looking for a simple solution to use IntEnum in choices and validate against it automatically:

https://github.com/hearthsim/django-intenumfield

@listingmirror
Copy link

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

@nathando
Copy link

nathando commented Jun 6, 2017

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 ?

@kjagiello
Copy link
Contributor

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

@nathando
Copy link

@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
Copy link
Contributor

kjagiello commented Jun 20, 2017

@nathando Oh, I see. I've just produced a quick bugfix for that issue. Not the nicest solution, but works. Check out #42

@nathando
Copy link

@kjagiello thank you! Hope some one review and merge it soon to release. Otherwise, other ppl will hit the same issue.

@naveenkumarsangi
Copy link

Hope someone reviews this pull request soon and merges it for native Enum support.

@bh
Copy link
Contributor

bh commented Sep 13, 2018

Works fine for Django 1.11.15. Thanks a lot.

@superduper
Copy link

Hey!
Any help needed on this PR? What's left to do in order to merge it?

@hannseman hannseman merged commit 5ef4072 into 5monkeys:master Aug 29, 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

Successfully merging this pull request may close these issues.

10 participants