【发布时间】:2015-08-23 18:00:50
【问题描述】:
def claim(request):
entries = Child_Info.objects.all()
ctx = { 'entries' : entries }
return render_to_response('myapp/claim.html', ctx)
这里如何传递多个上下文?
【问题讨论】:
-
也许您正在同一上下文中寻找更多对象?如果是这样,
ctx = {'entries': entries, 'another_obj': some_value}应该可以工作。 -
你为什么要使用多个上下文?
-
我想从多个模型或表中获取数据并且只想要特定的字段
标签: html django python-2.7 django-views