0
我更新我的应用程序Django的1.7,并试图python manage.py makemigrations
,出现以下错误的结果:Django的与RegexValidator makemigrations引发TypeError
TypeError: unbound method deconstruct() must be called with RegexValidator instance as first argument (got nothing instead)
为MyModel:
from django.core.validators import RegexValidator
name = models.CharField(max_length=50, validators=[RegexValidator])
在现实它更复杂,但我认为这会导致错误。我正在使用Python 2.7。
我读过关于migrations的Django文档,包括Adding a deconstruct() method和RegexValidator,但我不明白如何摆脱错误。