Django模板和MongoDB _id [英] Django Templates and MongoDB _id

查看:104
本文介绍了Django模板和MongoDB _id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Variables and attributes may not begin with underscores: 'value._id'

如何引用Django模板中从MongoDB获得的项目的_id?

How does one reference the _id of an item gotten from MongoDB in Django Templates?

推荐答案

您可以通过以下方式使用它:

You can use it this way:

{{ value|private:'_id' }}

这篇关于Django模板和MongoDB _id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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