def prefetch_modeladmin_get_queryset(modeladmin, *lookups):
    """
    Wraps default modeladmin ``get_queryset`` to prefetch related lookups.
    """

    def do_wrap(f):
        @wraps(f)
        def wrapper(request, *args, **kwargs):
            qs = f(request, *args, **kwargs)
            qs = qs.prefetch_related(*lookups)
            return qs

        return wrapper

    modeladmin.get_queryset = do_wrap(modeladmin.get_queryset)

    Wraps default modeladmin ``get_queryset`` to prefetch related lookups.
    
feincms/extensions/base.py