Is there a model MultiField (any way to compose db models Fields in Django)? Or why would not that be a useful concept?

不羁岁月 提交于 2019-12-01 12:40:51

Possible: Yes. You could either subclass djangos model class, or monkey-patch that class into the existing model module.

Just (educated) guessing: I think it is not missing, but not needed.

In DB-Applications, combined fields will almost always come with special business rules. So you will have to implement a different display and validation for each one of them anyway.

Which you already can easily do in the models.Form.

Maybe you should look at customization of models.Form?

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