def METHOD_NAME(self, **filter_kwargs):
    """
    Allows querying by attribute as if the attributes where fields on the
    product::
    >>> first_large_shirt = Product.objects.filter_by_attributes(size="Large").first()
    >>> first_large_shirt.attr.size
    <AttributeOption: Large>
    """
    attribute_filter = AttributeFilter(filter_kwargs)
    ProductAttribute = self.model.attributes.rel.model
    attribute_types = ProductAttribute.objects.values_list("code", "type").filter(
        code__in=attribute_filter.field_names()
    )
    return attribute_filter.fast_query(attribute_types, self)