def signalify_fetch_all(queryset, parser=None, **context):
    """Signal lazy load when `QuerySet._fetch_all` fetches rows. Note: patch
    `_fetch_all` instead of `iterator` since, as of Django 1.11, the former is
    used for all fetches while the latter is not.
    """
    func = queryset._fetch_all
    @functools.wraps(func)
    def wrapped(*args, **kwargs):
        if queryset._result_cache is None:
            signals.lazy_load.send(
                get_worker(),
                args=args,
                kwargs=kwargs,
                ret=None,
                context=context,
                parser=parser,
            )
        return func(*args, **kwargs)
    return wrapped
Signal lazy load when `QuerySet._fetch_all` fetches rows. Note: patch
    `_fetch_all` instead of `iterator` since, as of Django 1.11, the former is
    used for all fetches while the latter is not.