python - 属性错误: 'unicode' object has no attribute '_meta'

标签 python django

我在“python manage.py migrate contact”上收到此错误。

错误信息并未指出问题所在。

错误描述如下:

http://dpaste.com/68162/

她是一个示例模型定义:

http://dpaste.com/68173/

有人能指出我正确的方向吗???

我得到了这个:http://blog.e-shell.org/66

但无法找出问题所在。

最佳答案

问题解决了。有这样一行:

note = GenericRelation('Comment', object_id_field='object_pk')

在模型CompanyPerson中。但是 Comment 类未定义。我在两个地方都评论了该行。现在可以了。

感谢您的宝贵时间。

关于python - 属性错误: 'unicode' object has no attribute '_meta' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1142717/

相关文章:

Python Pandas Dataframe 存储下一行值

Django:如何将 <a> 超链接放入表单 clean() 方法的 django 验证错误中?

python - Django Cookiecutter 升级最佳实践

python - 自动将动态值放入表单

python - 如何表示具有多个属性的数据?

python - 使用 selenium (python) 单击 LinkedIn 按钮

Python - 将 For Loop 编写为文件作为生成器而不是 str/dict

python - Django ImageKit : add watermark and create thumbnail

python - 重用 django ORM 中的现有对象

python - 将导入的函数连接到 Qt5 进度条,无需依赖