2012-12-25 57 views
3

我使用Django-taggit-自动完成的,但做一个schememigrating的时候,我得到了一个错误Django的taggit,自动完成和南部

! Cannot freeze field 'main.hotels.tags' 
! (this field has class taggit_autocomplete_modified.managers.TaggableManagerAutocomplete) 
! Cannot freeze field 'main.rooms.tags' 
! (this field has class taggit_autocomplete_modified.managers.TaggableManagerAutocomplete) 

! 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 

于是我查了一下一下,发现Django的taggit-自动完成修饰,这应该解决问题,但它不会。

如何解决它的最佳方法是什么?

回答

3

最后我已经解决了添加如下代码问题的models.py

from south.modelsinspector import add_ignored_fields 
add_ignored_fields(["^taggit_autocomplete\.managers"]) 
+0

如果这是你正确的答案,这是更好地选择它作为_Correct Answer_。 –

0

下面是一些上下文@ Douglish自己的答案 - 取自South's documentation

就可以完全如果忽略某些领域你知道他们不需要。 例如,django-taggit有一个管理器,实际上显示为一个虚假的域(这使得API使用它更好,但将南方混淆到无尽)。我们用附带的Django的taggit模块包含此 规则忽略它:

from south.modelsinspector import add_ignored_fields 
add_ignored_fields(["^taggit\.managers"]) 
+0

请从链接添加一些内容。 – Robert