5monkeys / django-enumfield

Custom Django field for using enumerations of named constants
MIT License
204 stars 46 forks source link

Does this work with Django 1.9? #35

Closed sam-ghosh closed 6 years ago

sam-ghosh commented 8 years ago

I am seeing that it is supported till 1.8 as of late 2015 - is this working with 1.9 now?

Godod commented 8 years ago

@somghosh Hi. I'm using Django 1.9.6 and haven't problem with Enum

sanbales commented 8 years ago

This is not working for me on Django 1.9.

@Godod: did you migrate from an older version or did you start clean with 1.9.6?

This is a snipped of the code that fails for me:

from django.db import models
from django_enumfield import enum

class VisibilityKind(enum.Enum):
    PRIVATE = 1
    PROTECTED = 2
    PUBLIC = 3
    PACKAGE = 4

    labels = {
        PRIVATE: 'private',
        PROTECTED: 'protected',
        PUBLIC: 'public',
        PACKAGE: 'package',
    }

class NamedElement(models.Model):
    visibility = enum.EnumField(VisibilityKind)

makemigrations fails with this error code:

TypeError: Couldn't reconstruct field visibility on my_app.NamedElement: __init__() missing 1
required positional argument: 'enum'

Running Django 1.9.7 on Python 3.5.1

Godod commented 8 years ago

@sanbales I've started from django 1.9 and has been updated django every stable version. Now I have 1.9.8 and all ok with EnumField.

sanbales commented 8 years ago

@Godod thank you. I'll try to figure out what is going on. Cheers!

jturmel commented 8 years ago

Figure out what's wrong? I'm getting the same error too.

vlordier commented 8 years ago

@jturmel : pip install --pre django-enumfield==1.3b2 got me sorted with Django==1.9.9 and Python 3.4.3

jturmel commented 8 years ago

@vlordier that worked for me! Thanks.

andreif commented 7 years ago

Sorry folks, we'll push a stable update soon so it works without --pre.

Swamii commented 6 years ago

1.4 has been released. Please reopen if it doesn't work for any reason