I think you can restructure your view to look like this:
def home(request): aml_videos = AMLVideo.objects.filter().order_by("-category", "-language", "-level") volunteers = Volunteer.objects.all() context = {'aml_videos': aml_videos, 'volunteers': volunteers} return render(request, "aml/home.html", context)
Then your template would look like this:
<div class="row"> {% for volunteer in volunteers %} <div class="col-md-4 col-sm-6"> <div class="team-wrapper"> <div class="team-img"> <img src="{{ volunteer.img.url }}" class="img-responsive" alt="Image"> </div><!-- /.team-img --> <div class="team-title"> <h3><a href="#">{{ volunteer.name }}</a></h3> </div><!-- /.team-title --> </div><!-- /.team-wrapper --> </div><!-- /.col-md-4 --> {% endfor %} </div><!-- /.row -->
This solved the problem. Thank you!
Anytime!
Thanks for helping folks out and welcome to Dev.to!
My pleasure!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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!