def get_queryset(self, **kwargs): qs = super().get_queryset(**kwargs) query = self.request.GET.get('q') if query: qs = Snapshot.objects.filter(title__icontains=query) for snapshot in qs: snapshot.icons = get_icons(snapshot) return qs
def files(self, obj): return get_icons(obj)