(cls, case_ids)
return (
            cls.objects
            .filter(Q(potential_duplicates__case_id__in=case_ids))
            .annotate(potential_duplicates_count=models.Count("potential_duplicates"))
            .filter(potential_duplicates_count=1)
            .delete()
        )
Given a list of case_ids that are deleted, make sure there are no
        other CaseDuplicates pointing to them
Given a list of case_ids that are deleted, make sure there are no
        other CaseDuplicates pointing to them
Given a list of case_ids that are deleted make sure there are no other CaseDuplicates pointing to them
def bulk_remove_unique_cases(cls, case_ids):
        """Given a list of case_ids that are deleted, make sure there are no
        other CaseDuplicates pointing to them

        """
        return (
            cls.objects
            .filter(Q(potential_duplicates__case_id__in=case_ids))
            .annotate(potential_duplicates_count=models.Count("potential_duplicates"))
            .filter(potential_duplicates_count=1)
            .delete()
        )
def bulk_remove_unique_cases ( cls , case_ids ) : return ( cls . objects . filter ( Q ( potential_duplicates__case_id__in = case_ids ) ) . annotate ( potential_duplicates_count = models . Count ( "potential_duplicates" ) ) . filter ( potential_duplicates_count = 1 ) . delete ( ) )