{"action":"created","issue":{"url":"https://api.github.com/repos/django-oscar/django-oscar/issues/2888","repository_url":"https://api.github.com/repos/django-oscar/django-oscar","labels_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/2888/labels{/name}","comments_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/2888/comments","events_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/2888/events","html_url":"https://github.com/django-oscar/django-oscar/pull/2888","id":384724824,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzODU2MTY5","number":2888,"title":"Added method to Product manager for filtering on product attributes.","user":{"login":"highbiza","id":45388312,"node_id":"MDQ6VXNlcjQ1Mzg4MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/45388312?v=4","gravatar_id":"","url":"https://api.github.com/users/highbiza","html_url":"https://github.com/highbiza","followers_url":"https://api.github.com/users/highbiza/followers","following_url":"https://api.github.com/users/highbiza/following{/other_user}","gists_url":"https://api.github.com/users/highbiza/gists{/gist_id}","starred_url":"https://api.github.com/users/highbiza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highbiza/subscriptions","organizations_url":"https://api.github.com/users/highbiza/orgs","repos_url":"https://api.github.com/users/highbiza/repos","events_url":"https://api.github.com/users/highbiza/events{/privacy}","received_events_url":"https://api.github.com/users/highbiza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-27T10:28:26Z","updated_at":"2018-11-27T10:59:37Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/django-oscar/django-oscar/pulls/2888","html_url":"https://github.com/django-oscar/django-oscar/pull/2888","diff_url":"https://github.com/django-oscar/django-oscar/pull/2888.diff","patch_url":"https://github.com/django-oscar/django-oscar/pull/2888.patch"},"body":"Hi here is some functionality that allows one to use product attributes more as opposed to subclassing the product model. A method was added to the product manager that allows querying/filtering on product attributes.\r\n\r\nexample:\r\n```\r\nProduct.objects.filter_by_attributes(height__lt=100, google_shopping=True)\r\n```\r\n\r\nIt will produce queries like this:\r\n```\r\nSELECT \"catalogue_product\".\"id\", \"catalogue_product\".\"structure\", \"catalogue_product\".\"upc\", \"catalogue_product\".\"parent_id\", \"catalogue_product\".\"title\", \"catalogue_product\".\"slug\", \"catalogue_product\".\"description\", \"catalogue_product\".\"product_class_id\", \"catalogue_product\".\"rating\", \"catalogue_product\".\"date_created\", \"catalogue_product\".\"date_updated\", \"catalogue_product\".\"is_discountable\", \"catalogue_product\".\"vat_rate\"\r\n    FROM \"catalogue_product\"\r\n    INNER JOIN \"catalogue_productattributevalue\" GOOGLE_SHOPPING4\r\n    ON (\r\n        \"catalogue_product\".\"id\" = GOOGLE_SHOPPING4.\"product_id\"\r\n        AND\r\n        (GOOGLE_SHOPPING4.\"attribute_id\" = 2)\r\n    )\r\n    INNER JOIN \"catalogue_productattributevalue\" HEIGHT4\r\n    ON (\r\n        \"catalogue_product\".\"id\" = HEIGHT4.\"product_id\"\r\n        AND\r\n        (HEIGHT4.\"attribute_id\" = 3)\r\n    )\r\n    WHERE (\r\n        GOOGLE_SHOPPING4.\"value_boolean\" = True\r\n        AND HEIGHT4.\"value_integer\" < 100\r\n        AND \"catalogue_product\".\"product_class_id\" = 4\r\n    )\r\n    ORDER BY \"catalogue_product\".\"date_created\"\r\nDESC\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/django-oscar/django-oscar/issues/comments/442017083","html_url":"https://github.com/django-oscar/django-oscar/pull/2888#issuecomment-442017083","issue_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/2888","id":442017083,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjAxNzA4Mw==","user":{"login":"specialunderwear","id":52858,"node_id":"MDQ6VXNlcjUyODU4","avatar_url":"https://avatars1.githubusercontent.com/u/52858?v=4","gravatar_id":"","url":"https://api.github.com/users/specialunderwear","html_url":"https://github.com/specialunderwear","followers_url":"https://api.github.com/users/specialunderwear/followers","following_url":"https://api.github.com/users/specialunderwear/following{/other_user}","gists_url":"https://api.github.com/users/specialunderwear/gists{/gist_id}","starred_url":"https://api.github.com/users/specialunderwear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/specialunderwear/subscriptions","organizations_url":"https://api.github.com/users/specialunderwear/orgs","repos_url":"https://api.github.com/users/specialunderwear/repos","events_url":"https://api.github.com/users/specialunderwear/events{/privacy}","received_events_url":"https://api.github.com/users/specialunderwear/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T10:59:37Z","updated_at":"2018-11-27T10:59:37Z","author_association":"MEMBER","body":"The best I can do is skip the tests and disable the functionality"}}
{"actor":{"display_login":"specialunderwear"}}