Skip to content

Commit

Permalink
Use enumfield path in deconstruct for Django 1.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
andreif committed Nov 17, 2015
1 parent c747820 commit 2820dac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_enumfield/db/fields.py
Expand Up @@ -83,9 +83,10 @@ def south_field_triple(self):

def deconstruct(self):
name, path, args, kwargs = super(EnumField, self).deconstruct()
path = "django.db.models.fields.IntegerField"
if django.VERSION >= (1, 9):
kwargs['enum'] = self.enum
else:
path = "django.db.models.fields.IntegerField"
if 'choices' in kwargs:
del kwargs['choices']
return name, path, args, kwargs

0 comments on commit 2820dac

Please sign in to comment.