def METHOD_NAME(self, items, queryset):
    if items:
        lesson_ids = [l["id"] for l in items]
        adhoc_assignments = LessonAssignment.objects.filter(
            lesson_id__in=lesson_ids, collection__kind=ADHOCLEARNERSGROUP
        )
        adhoc_assignments = annotate_array_aggregate(
            adhoc_assignments, learner_ids="collection__membership__user_id"
        )
        adhoc_assignments = {
            a["lesson"]: a
            for a in adhoc_assignments.values("collection", "lesson", "learner_ids")
        }
        for item in items:
            if item["id"] in adhoc_assignments:
                adhoc_assignment = adhoc_assignments[item["id"]]
                item["learner_ids"] = adhoc_assignments[item["id"]]["learner_ids"]
                item["lesson_assignments"] = [
                    i
                    for i in item["lesson_assignments"]
                    if i != adhoc_assignment["collection"]
                ]
            else:
                item["learner_ids"] = []
            item["resources"] = item["resources"] or []
    return items