def METHOD_NAME(self, queryset, name, value):
    """Transform value into an integer and filter by exact value."""
    try:
        value = int(value)
    except ValueError:
        raise exceptions.ParseError(f"Value of attribute {name} must be a number.")
    return queryset.filter(**{name: value})