How to call a static methods on a django model class during a south migration

五迷三道 提交于 2019-11-30 06:03:45

You can't use methods from models.py in south migrations. The reason is that in the future models.py will evolve and sooner or later you will delete those methods, then migration will be broken.

You should put all code needed by migration in migration file itself.

Here's the pertinent section of the South docs explaining why your methods don't work:

Rationale behind the serialisation

Aren't you using different names lookup_by_name and lookup_name?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!