How to make master-detail model / screen in Django?

假装没事ソ 提交于 2019-12-03 17:33:33
furins
  • master and detail models are two separate models related by a One-to-Many relationship. To incorporate them in the same form you have to use Model Formsets (more details here).
  • to dynamically add rows you may consider this answer
  • the same applies to autocalculate fields, you can do it in pure javascript or with an ajax call to a "calculation view" (thus the code is in the template or in your views, eventually calling other modules like models, it really depends on which calculation are you doing)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!