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 [email protected]. To post to this group, send email to [email protected]. 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.

