Your view is not well structured. I see you repeating Volunteer.objects.all() twice. Also, your context is sending in a request obj, you are supposed to send the data that you fetched from your database i.e Volunteer.objects.all(). Also what's the amlvideo = AMLVideo.objects.filter().order_by("-category", "-language", "-level") for? You are not sending it to the template
Ok so I removed the other Volunteer.objects.all() already. I would send those to the template. Just not on this model. How am I supposed to send the data form my database then?
Alyss has been working in tech since 2012, with diverse experience in Sales Engineering, Developer Advocacy, and Product Marketing with companies such as GitHub, Box, Atlassian, and BigCommerce.
Your
view
is not well structured. I see you repeating Volunteer.objects.all() twice. Also, your context is sending in arequest
obj, you are supposed to send the data that you fetched from your database i.eVolunteer.objects.all()
. Also what's theamlvideo = AMLVideo.objects.filter().order_by("-category", "-language", "-level")
for? You are not sending it to the templateOk so I removed the other Volunteer.objects.all() already. I would send those to the template. Just not on this model. How am I supposed to send the data form my database then?
I think you can restructure your view to look like this:
Then your template would look like this:
This solved the problem. Thank you!
Anytime!
Thanks for helping folks out and welcome to Dev.to!
My pleasure!