6
我寫一個Django向南遷移是依賴於另一個應用程序的模型,所以我已經包括--freeze OTHERAPPNAME
當我跑python manage.py datamigration …
Django-South DataMigration - 應用程序可用於轉發()但不能倒退()?
然而在forwards()
功能我可以訪問其他模型罰款(含orm['otherappname.MyModelName']
),然而在在backwards()
步驟(這還取決於otherappname模型),如果我嘗試訪問orm['otherappname.MyModelName']
,我得到一個錯誤
*** KeyError: "The model 'mymodelname' from the app 'otherappname' is not available in this migration."
我可以看到在文件的底部冷凍模型的細節。爲什麼我無法訪問它?
注意:該模型是在此數據遷移所依賴的其他遷移內部另一個遷移中創建的。