Skip to content Skip to sidebar Skip to footer

Many Duplicate Queries When Using Image Tag In Wagtail

I'm using Wagtail v1.13.1 for my website project. I'm trying to optimize db queries... models.py class ProductPage(Page): ... main_image = models.ForeignKey( 'wagta

Solution 1:

Try this.

prefetch_related('main_image__rendition_set')

This is assuming that the image templatetag can use the prefetched values correctly.


Post a Comment for "Many Duplicate Queries When Using Image Tag In Wagtail"