Closed einsfr closed 6 years ago
My fault - example is incomplete - real application fails when there is a 'prefetch_related'. Something about this:
products = return Product.objects.live().filter(pk__in=pks).prefetch_related(
models.Prefetch(
'prices',
queryset=ProductPrice.objects.filter(price_type=price_type)
)
)
prices = [p.get_price_by_type(price_type) for p in products]
I'm using modelcluster with wagtail CMS and faced a regress after packages upgrade (wagtail 1.13.1 > 2.0, django-modelcluster 3.1 > 4.1). For example:
Calling _get_price_bytype with modelcluster 3.1 results in:
And with modelcluster 4.1: