可以在django-template中遍历pymongo.cursor.Cursor对象吗?
发布于 2011-08-30 20:07:40
是的这是可能的。Pymongo游标实现了标准的Python utterable方法,因此您可以使用{% for element in cursor %}...{% endfor %}遍历游标的值,就像使用列表或其他可迭代序列一样。
{% for element in cursor %}...{% endfor %}
https://stackoverflow.com/questions/7240618
相似问题