I am trying to render a list of lists zipped with zip().
list_of_list = zip(location,rating,images)
I want to render this list_of_list to template and want to show only the first image of each location.
my location and image models are these:
class Location(models.Model):
locationname = models.CharField
class Image(models.Model):
of_location = ForeignKey(Location,related_name="locs_image")
img = models.ImageField(upload_to=".",default='')
here is the zipped list. How can I access only the first image of each location in template?

all_locations = Location.objects.all()and in template{% for loc in all_locations %} {% for img in loc.locs_image.all %}{{img.img.name}} {% endfor %} {% endfor %}?slicetag in templates.