def get_matching_for_product(shop_product, provide_category, skippable_classes=None):
 collected = set()
 matcher = ProductCampaignMatcher(shop_product)
 for item in get_provide_objects(provide_category):
  if skippable_classes:
   objects = item._meta.model.objects.not_instance_of(*skippable_classes).all()
  else:
   objects = item._meta.model.objects.all()
  for obj in objects:
   if matcher.matches(obj):
    collected.add(obj.pk)
 return collected

def get_matching_for_product ( shop_product , provide_category , skippable_classes = None ) : collected = set ( ) matcher = ProductCampaignMatcher ( shop_product ) for item in get_provide_objects ( provide_category ) : if skippable_classes : objects = item . _meta . model . objects . not_instance_of ( * skippable_classes ) . all ( ) else : objects = item . _meta . model . objects . all ( ) for obj in objects : if matcher . matches ( obj ) : collected . add ( obj . pk ) return collected
get matching ids for shop product based on provide category for example: matching_ids = get_matching_for_product .