def METHOD_NAME(self, value):
    qs = ComplianceCheck.objects.filter(model=InventoryJMESPathCheck.get_model(), name=value)
    if self.instance:
        qs = qs.exclude(pk=self.instance.compliance_check.pk)
    if qs.count():
        raise serializers.ValidationError(
            f"A {InventoryJMESPathCheck.model_display} with this name already exists."
        )
    return value