django-eav 和南
我正在启动一个新的 django 项目,并且像往常一样,我将其放在已安装的应用程序上。
然后我需要某种 eav 来存储模型中的一些字段,我找到了一个完全符合我想要的功能的应用程序,那就是 django-eav ( https://github.com/mvpdev/django-eav )
但现在我面临一个问题,因为南抱怨不知道如何使用django-eav。
! Cannot freeze field 'eav.attribute.slug'
! (this field has class eav.fields.EavSlugField)
! Cannot freeze field 'eav.attribute.datatype'
! (this field has class eav.fields.EavDatatypeField)
! South cannot introspect some fields; this is probably because they are custom
! fields. If they worked in 0.6 or below, this is because we have removed the
! models parser (it often broke things).
! To fix this, read http://south.aeracode.org/wiki/MyFieldsDontWork
我正在阅读此http://south.aeracode.org/docs/customfields.html 我正在尝试解决这个问题而不放弃这两个项目中的任何一个。
有人可以帮助我吗? 谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到的最佳答案来自 http://south.aeracode。 org/docs/settings.html#setting-south-migration-modules
建议您在 settings.py 中设置添加 SOUTH_MIGRATION_MODULES 字典,并将该应用程序映射到不存在的模块
The best answer I found was from http://south.aeracode.org/docs/settings.html#setting-south-migration-modules
It suggests that you set add a SOUTH_MIGRATION_MODULES dict in settings.py, and map that app to a nonexistent module
从 github 来看,django-eav 的开发似乎并不活跃。如果它按您想要的方式工作并且您不希望更改其数据模型,则不需要对其应用 South。 South 可以很好地管理某些应用程序,但不能管理其他应用程序。
一定要在您正在构建和修改的应用程序上使用 South。但对于一个稳定的库,我很少打扰。
Looking at github it appears that django-eav is not under very active development. If it's working as you want and you don't expect to change its data model, you don't need to apply South to it. South works fine managing some apps and not others.
Definitely use South on the apps that you're building and modifying. But for a stable library, I rarely bother.
我想我找到了一个可能的解决方案。
http://south.aeracode.org/docs/customfields.html#field -name-patterns
在我的模型旁边我放了这个:
现在它可以工作了。
I think i found one possible solution.
http://south.aeracode.org/docs/customfields.html#field-name-patterns
Next to my model i put this:
now it works.