如何从Django中的表单模板访问模型 [英] How to Access model from Form template in Django

查看:101
本文介绍了如何从Django中的表单模板访问模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个窗体来编辑模型。在模板中,虽然我想访问模型。这是可能的,我该如何实现?

解决方案

{{model_form._meta.model}}


I have a form that edits a model. In the template though I would like to access the model. Is this possible and how can I accomplish this?

解决方案

{{ model_form._meta.model }}

这篇关于如何从Django中的表单模板访问模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆