有两种观点
视图.py
def followup(request):
''''''
marklist = report_template(request)
return render(request, 'incident/followup.html',{'somevar':somevar})
def report_template(request):
'''''
report=Report.objects.filter(report=report_id)
''''''
return render(request, 'incident/print.html',
{'report':report})
我在另一个方法中调用一个方法。将 report_template 方法调用到后续方法中。后续方法也有要在模板中呈现的变量。
如何将 report_template 方法的变量传递给后续方法并使其显示在模板中。
谢谢