Skip to content

Commit

Permalink
Add 'deconstruct' method for Django 1.7 migration support
Browse files Browse the repository at this point in the history
  • Loading branch information
samh authored and Sam Hartsfield committed Jun 30, 2014
1 parent b572cb6 commit 7b4c20b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enumfields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def get_default(self):

return super(EnumFieldMixin, self).get_default()

def deconstruct(self):
name, path, args, kwargs = super(EnumFieldMixin, self).deconstruct()
kwargs['enum'] = self.enum
return name, path, args, kwargs


class EnumField(EnumFieldMixin, models.CharField):
def __init__(self, enum, *args, **kwargs):
Expand Down

0 comments on commit 7b4c20b

Please sign in to comment.