old_contents: import django_filters
  
  from ...shipping.models import ShippingZone
  from ..channel.types import Channel
  from ..core.filters import GlobalIDMultipleChoiceFilter
  from ..core.types import FilterInputObjectType
  from ..utils import resolve_global_ids_to_primary_keys
  from ..utils.filters import filter_fields_containing_value
  
  
  def filter_channels(qs, _, values):
      if values:
          _, channels_ids = resolve_global_ids_to_primary_keys(values, Channel)
          qs = qs.filter(channels__id__in=channels_ids)
      return qs
  
  
  class ShippingZoneFilter(django_filters.FilterSet):
      search = django_filters.CharFilter(method=filter_fields_containing_value("name"))
      channels = GlobalIDMultipleChoiceFilter(method=filter_channels)
  
      class Meta:
          model = ShippingZone
          fields = ["search"]
  
  
  class ShippingZoneFilterInput(FilterInputObjectType):
      class Meta:
          filterset_class = ShippingZoneFilter
  
new_contents: import django_filters
  
  from ...shipping.models import ShippingZone
  from ..channel.types import Channel
  from ..core.filters import GlobalIDMultipleChoiceFilter
  from ..core.types import FilterInputObjectType
  from ..utils import resolve_global_ids_to_primary_keys
  
  
  def filter_channels(qs, _, values):
      if values:
          _, channels_ids = resolve_global_ids_to_primary_keys(values, Channel)
          qs = qs.filter(channels__id__in=channels_ids)
      return qs
  
  
  def filter_shipping_zones_search(qs, _, value):
      return qs.filter(name__ilike=value)
  
  
  class ShippingZoneFilter(django_filters.FilterSet):
      search = django_filters.CharFilter(method=filter_shipping_zones_search)
      channels = GlobalIDMultipleChoiceFilter(method=filter_channels)
  
      class Meta:
          model = ShippingZone
          fields = ["search"]
  
  
  class ShippingZoneFilterInput(FilterInputObjectType):
      class Meta:
          filterset_class = ShippingZoneFilter
  
subject: Improve shipping zone filters performance