我有一个简单的模板
{% extends "layout/index.html" %}
{% load inplace_edit %}
{% inplace_edit "category.name" %}
{% for item in items %}
{% inplace_edit "item.title" %}
{% endfor %}
我的意见.py
def category(request, category_id):
return render_to_response("items/category.html",
{
'category':category,
'items':Item.objects.filter(site__categories__id=category_id).filter(publicated=True).order_by('-created'),
},
context_instance=RequestContext(request))
当我尝试编辑类别时一切正常
{% inplace_edit "category.name" %}
但是,当我尝试在循环中的项目中插入编辑器时,出现错误:
VariableDoesNotExist at /category/1/ 在 u 中查找键 ["item] 失败"[{'False': False, 'None': None, 'True': True}, {}, {}]"