57👍
✅
objects
isn’t callable (is an attribute).
-
Talk.objects()
–> won’t work -
Talk.objects
–> will work
So instead of trying to call it like this:
# Create your views here.
def talksIndex(request):
latest_talk = Talk.objects().all()
return render_to_response('talks/index.html', {'latest_talk': latest_talk})
Try this:
# Create your views here.
def talksIndex(request):
latest_talk = Talk.objects.all()
return render_to_response('talks/index.html', {'latest_talk': latest_talk})
And the same with the other examples
Source:stackexchange.com