From 85a9f8e6b146e35724b95b04ea252d33cbc73ef9 Mon Sep 17 00:00:00 2001 From: Rodney Folz Date: Fri, 25 Apr 2014 13:32:49 -0700 Subject: [PATCH] Fix "model '%s' must have a %s choices class attribute" error on migrations. --- model_utils/fields.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/model_utils/fields.py b/model_utils/fields.py index 6ff8537..5b14d1e 100644 --- a/model_utils/fields.py +++ b/model_utils/fields.py @@ -70,6 +70,11 @@ class StatusField(models.CharField): self._choices = [(0, 'dummy')] super(StatusField, self).contribute_to_class(cls, name) + def deconstruct(self): + name, path, args, kwargs = super(StatusField, self).deconstruct() + kwargs['no_check_for_status'] = self.check_for_status + return name, path, args, kwargs + class MonitorField(models.DateTimeField): """