How to migrate models from a models package hierarchy and not from models.py with SOUTH in Django?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 05:25:17

问题


Hy!

I have my models in a hierarchy below "models" package:

 models
 |-a.py
 |-b.py

instead of having all my models into the models.py

But when I run the migration command for South it doesn't find any of them:

schemamigration my_app --auto

In the meta class already exists the app_label='my_app'

I use auto because the tables are already changed.


回答1:


Have you imported all the models in __init__.py? If you've done that, there's effectively no difference in how it works.



来源:https://stackoverflow.com/questions/8123125/how-to-migrate-models-from-a-models-package-hierarchy-and-not-from-models-py-wit

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