{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/233228364","pull_request_review_id":174589576,"id":233228364,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzIyODM2NA==","diff_hunk":"@@ -327,9 +329,22 @@ def __or__(self, other):\n             return other\n         if isinstance(other, EmptyQuerySet):\n             return self\n-        combined = self._chain()\n+\n+        if not self.query.can_filter():\n+            pks = Subquery(self.values('pk'))\n+            query = self.model.objects.filter(pk__in=pks)","path":"django/db/models/query.py","position":19,"original_position":19,"commit_id":"71bc84fba47823b9097f5aacb5a60ce2ff166193","original_commit_id":"71bc84fba47823b9097f5aacb5a60ce2ff166193","user":{"login":"charettes","id":9293,"node_id":"MDQ6VXNlcjkyOTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9293?v=4","gravatar_id":"","url":"https://api.github.com/users/charettes","html_url":"https://github.com/charettes","followers_url":"https://api.github.com/users/charettes/followers","following_url":"https://api.github.com/users/charettes/following{/other_user}","gists_url":"https://api.github.com/users/charettes/gists{/gist_id}","starred_url":"https://api.github.com/users/charettes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charettes/subscriptions","organizations_url":"https://api.github.com/users/charettes/orgs","repos_url":"https://api.github.com/users/charettes/repos","events_url":"https://api.github.com/users/charettes/events{/privacy}","received_events_url":"https://api.github.com/users/charettes/received_events","type":"User","site_admin":false},"body":"Use `self.model._base_manager`.","created_at":"2018-11-13T21:28:32Z","updated_at":"2018-11-13T21:35:46Z","html_url":"https://github.com/django/django/pull/10644#discussion_r233228364","pull_request_url":"https://api.github.com/repos/django/django/pulls/10644","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/233228364"},"html":{"href":"https://github.com/django/django/pull/10644#discussion_r233228364"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/10644"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/10644","id":230624133,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNjI0MTMz","html_url":"https://github.com/django/django/pull/10644","diff_url":"https://github.com/django/django/pull/10644.diff","patch_url":"https://github.com/django/django/pull/10644.patch","issue_url":"https://api.github.com/repos/django/django/issues/10644","number":10644,"state":"open","locked":false,"title":"Fixed #17930 -- Support QuerySet.__or__ with slicing","user":{"login":"Ian-Foote","id":1843202,"node_id":"MDQ6VXNlcjE4NDMyMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/1843202?v=4","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-13T21:04:55Z","updated_at":"2018-11-13T21:35:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"360f1dd2b0197f448fb640ca5b4ad77f72351f13","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/10644/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/10644/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/10644/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/71bc84fba47823b9097f5aacb5a60ce2ff166193","head":{"label":"Ian-Foote:ticket_17930","ref":"ticket_17930","sha":"71bc84fba47823b9097f5aacb5a60ce2ff166193","user":{"login":"Ian-Foote","id":1843202,"node_id":"MDQ6VXNlcjE4NDMyMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/1843202?v=4","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"repo":{"id":16351410,"node_id":"MDEwOlJlcG9zaXRvcnkxNjM1MTQxMA==","name":"django","full_name":"Ian-Foote/django","private":false,"owner":{"login":"Ian-Foote","id":1843202,"node_id":"MDQ6VXNlcjE4NDMyMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/1843202?v=4","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Ian-Foote/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/Ian-Foote/django","forks_url":"https://api.github.com/repos/Ian-Foote/django/forks","keys_url":"https://api.github.com/repos/Ian-Foote/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ian-Foote/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ian-Foote/django/teams","hooks_url":"https://api.github.com/repos/Ian-Foote/django/hooks","issue_events_url":"https://api.github.com/repos/Ian-Foote/django/issues/events{/number}","events_url":"https://api.github.com/repos/Ian-Foote/django/events","assignees_url":"https://api.github.com/repos/Ian-Foote/django/assignees{/user}","branches_url":"https://api.github.com/repos/Ian-Foote/django/branches{/branch}","tags_url":"https://api.github.com/repos/Ian-Foote/django/tags","blobs_url":"https://api.github.com/repos/Ian-Foote/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ian-Foote/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ian-Foote/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ian-Foote/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ian-Foote/django/statuses/{sha}","languages_url":"https://api.github.com/repos/Ian-Foote/django/languages","stargazers_url":"https://api.github.com/repos/Ian-Foote/django/stargazers","contributors_url":"https://api.github.com/repos/Ian-Foote/django/contributors","subscribers_url":"https://api.github.com/repos/Ian-Foote/django/subscribers","subscription_url":"https://api.github.com/repos/Ian-Foote/django/subscription","commits_url":"https://api.github.com/repos/Ian-Foote/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ian-Foote/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ian-Foote/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ian-Foote/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ian-Foote/django/contents/{+path}","compare_url":"https://api.github.com/repos/Ian-Foote/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ian-Foote/django/merges","archive_url":"https://api.github.com/repos/Ian-Foote/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ian-Foote/django/downloads","issues_url":"https://api.github.com/repos/Ian-Foote/django/issues{/number}","pulls_url":"https://api.github.com/repos/Ian-Foote/django/pulls{/number}","milestones_url":"https://api.github.com/repos/Ian-Foote/django/milestones{/number}","notifications_url":"https://api.github.com/repos/Ian-Foote/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ian-Foote/django/labels{/name}","releases_url":"https://api.github.com/repos/Ian-Foote/django/releases{/id}","deployments_url":"https://api.github.com/repos/Ian-Foote/django/deployments","created_at":"2014-01-29T16:52:51Z","updated_at":"2018-11-12T14:27:55Z","pushed_at":"2018-11-13T21:04:24Z","git_url":"git://github.com/Ian-Foote/django.git","ssh_url":"git@github.com:Ian-Foote/django.git","clone_url":"https://github.com/Ian-Foote/django.git","svn_url":"https://github.com/Ian-Foote/django","homepage":"http://www.djangoproject.com/","size":174914,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"2f120ac51722a257219a7577759702605cefddf4","user":{"login":"django","id":27804,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODA0","avatar_url":"https://avatars2.githubusercontent.com/u/27804?v=4","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"node_id":"MDEwOlJlcG9zaXRvcnk0MTY0NDgy","name":"django","full_name":"django/django","private":false,"owner":{"login":"django","id":27804,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODA0","avatar_url":"https://avatars2.githubusercontent.com/u/27804?v=4","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","deployments_url":"https://api.github.com/repos/django/django/deployments","created_at":"2012-04-28T02:47:18Z","updated_at":"2018-11-13T21:11:47Z","pushed_at":"2018-11-13T21:10:45Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":183699,"stargazers_count":37548,"watchers_count":37548,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16196,"mirror_url":null,"archived":false,"open_issues_count":173,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16196,"open_issues":173,"watchers":37548,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/10644"},"html":{"href":"https://github.com/django/django/pull/10644"},"issue":{"href":"https://api.github.com/repos/django/django/issues/10644"},"comments":{"href":"https://api.github.com/repos/django/django/issues/10644/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/10644/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/10644/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/71bc84fba47823b9097f5aacb5a60ce2ff166193"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"charettes"}}