# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib.admin import SimpleListFilter
from django.utils.translation import ugettext_lazy as _

from shop_catalog.models import Product


class ProductParentListFilter(SimpleListFilter):
    title = _('Parent')
    parameter_name = 'parent'

    def lookups(self, request, model_admin):
        lookups = ()

        for product in Product.objects.all():
            if product.is_group:
                lookups += (product.pk, product.get_name()),

        return lookups

    def queryset(self, request, queryset):
        if self.value():
            try:
                return queryset.get(pk=self.value()).variants.all()
            except Product.DoesNotExist:
                pass
        return queryset

@@ -58,16 +58,47 @@
 terals%0A%0A
+from django.db.models import Q%0A
 from dja
@@ -658,142 +658,100 @@
     
-try:%0A                return queryset.get(pk=self.value()).variants.all()%0A            except Product.DoesNotExist:%0A                pass
+queryset = queryset.filter(%0A                Q(pk=self.value()) %7C Q(parent_id=self.value()))%0A
 %0A   

Modify parent filter to return variants and self