def get_queryset(self):
        if self.relation_names is None:
            raise ImproperlyConfigured(
                "'%s' must define 'relation_names'" %
                self.__class__.__name__)
        if not isinstance(self.relation_names, (tuple, list)):
            raise ImproperlyConfigured(
                "%s's relation_names property must be a tuple or list." %
                self.__class__.__name__)
        return super(PrefetchRelatedMixin, self
                     ).get_queryset().prefetch_related(*self.relation_names)
Check if relation_names is correctly set and
dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/views/mixins/prefetch_related.py/PrefetchRelatedMixin.get_queryset