I am just making a simple website as I am learning django.
I have a view function that looks like this:
def vieworkout(request):
date= datetime.today()
obj = userworkouts.objects.filter(userid=52)
date = request.POST['date']
context = {
'exercise': obj.exercise
}
return render(request, 'clientIndex.html', context)
when I use userworkouts.object.get() I can pass the exercise object no problem. When I change it to filter I get an error, "'QuerySet' object has no attribute 'exercise'". Does anyone know why this is happening?