Is there a way to add fields onto Django's Sites Framework?

不打扰是莪最后的温柔 提交于 2020-01-04 07:00:28

问题


I really like the idea of the sites framework for making an application functional across multiple web sites. Is there a way to add fields onto the Site object for the database, or should I just create a foreign-key one-to-one relationship?


回答1:


Yes, use a model with a unique foreign key. Django will add it to Site as a reverse relationship.



来源:https://stackoverflow.com/questions/6892198/is-there-a-way-to-add-fields-onto-djangos-sites-framework

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