def METHOD_NAME(location_ids):
    for location_definition in LocationFilterDefinition.objects.filter(location_id__in=location_ids):
        for criteria in location_definition.caserulecriteria_set.all():
            rule = criteria.rule
            rule.delete_criteria()
            rule.delete_actions()
            rule.delete()
        location_definition.delete()