Django报:AttributeError: tuple object has no attribute get

def index(request):
    hero_list=models.HeroInfo.objects.all()
    return render_to_response('index.html',{'hero_list':hero_list})

视图方法RS,少了return就会报这个错,可以通过,对models的方法的对象一一检查。

posted @ 2017-12-16 23:32  phyger  阅读(4796)  评论(0编辑  收藏  举报