Thanks, but I am getting this error: 'Product' object has no attribute 'productimages_set'
On Tuesday, July 11, 2017 at 5:29:15 AM UTC-4, ecas wrote: > > > You can query for the images, and keep the first one for the template > rendering. > > products = Product.objects.all() > for product in products: > products.image = product.productimages_set.first() > > > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bbb52ba2-0dbd-4965-a285-95a410acdf5f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.