2012-12-25 54 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