syncdb =错误:一个或多个模型未验证

时间:2012-12-06 15:49:41

标签: django uuid django-south

当我manage.py syncdb时,我得到:

Error: One or more models did not validate:
users.userprofile: "uuid": Primary key fields cannot have null=True.

即使我的class UserProfile(models.Model)有:

uuid = UUIDField(primary_key=True, auto=True, editable=False)

1 个答案:

答案 0 :(得分:0)

来自Daniel的评论可能就是这样,我只是不知道如何理解线索。

来自Joshua的修正方法是删除官方django-uuidfield并将其替换为约书亚的fork

-django-uuidfield==0.4
-django-uuidfield-2==0.6.5
+# django-uuidfield==0.4
+# django-uuidfield-2==0.6.5
+-e git://github.com/joshuakarjala/django-uuidfield.git#egg=django-uuidfield

pip uninstall django-uuidfield之前请记得pip uninstall django-uuidfield-2pip install -r requirements.txt