I have a list made by All elements are queries that are dynamic I The image is as follows: There may be multiple images Now I want to show the item on that template and to repeat that Thanks for the help If the zip
List = zip (rating, image, comment)
class image (request): location_id = models.IntegerField () bild = models.ImageField (upload_to = ".", Default = '')
list I'm grounded. Say, there are 2 images in one place. My problem is:
{rate for%, image,% in list} How do I show both pictures of one place here? <{Image.bild.name}} gives me the first image {% endfor%}
location should be a field or property of the class, which gives you relevant ratings / comments / images. You can then pass a list of
location on your template.
location is a Django model, then the rating / comments / images should be in each
ForeignKey in the
location Indicates. In that case, Django will create properties on the code / location / which points to that rating / comments / images. Use
related_name to choose the name of that property, otherwise the name of Django will be invented.
No comments:
Post a Comment