admin管理员组文章数量:1125477
In the admin panel of a django app when you are adding a database entry that links data from another table on a foreign key you get a dropdown to select the entry and 3 buttons to edit, add or view an entry like this:
However when you create a form for this model to take data from a user, the linked data only shows the dropdown menu and no buttons:
Is there any way that I can add the 'add' and 'view' button on the input form so that the user can view an entry in more detail if unsure or add a new entry if the required information is not already in the database?
It seems like it should be pretty simple if the functionality is already there for admin panel and would be neater than implementing some custom pages to load the data for viewing or redirecting to another form to add the new data?
本文标签: pythonAdd buttom from admin panel to ModelForm in DjangoStack Overflow
版权声明:本文标题:python - Add buttom from admin panel to ModelForm in Django - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736642037a1946016.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论