{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/93791041","pull_request_review_id":14327730,"id":93791041,"diff_hunk":"@@ -815,6 +815,25 @@ def complex_filter(self, filter_obj):\n         else:\n             return self._filter_or_exclude(None, **filter_obj)\n \n+    def _combinator_query(self, combinator, *other_qs):\n+        # Clone the query so we inherit the select list and everything\n+        clone = self._clone()\n+        # Clear limits and ordering, so they can be reapplied\n+        clone.query.clear_ordering(True)\n+        clone.query.clear_limits()\n+        clone.query.combined_queries = (self.query,) + tuple(qs.query for qs in other_qs)\n+        clone.query.combinator = combinator\n+        return CombinedQuerySet(clone)\n+\n+    def union(self, *other_qs):","path":"django/db/models/query.py","position":14,"original_position":14,"commit_id":"0478b43b9bbcc6df042a51044cf5303e0fc92a11","original_commit_id":"c2d3a2f9579ae9335dffb7e76e6f06ec9fbb5c36","user":{"login":"apollo13","id":81547,"avatar_url":"https://avatars.githubusercontent.com/u/81547?v=3","gravatar_id":"","url":"https://api.github.com/users/apollo13","html_url":"https://github.com/apollo13","followers_url":"https://api.github.com/users/apollo13/followers","following_url":"https://api.github.com/users/apollo13/following{/other_user}","gists_url":"https://api.github.com/users/apollo13/gists{/gist_id}","starred_url":"https://api.github.com/users/apollo13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apollo13/subscriptions","organizations_url":"https://api.github.com/users/apollo13/orgs","repos_url":"https://api.github.com/users/apollo13/repos","events_url":"https://api.github.com/users/apollo13/events{/privacy}","received_events_url":"https://api.github.com/users/apollo13/received_events","type":"User","site_admin":false},"body":"Guess that makes sense, will fix it later on","created_at":"2016-12-23T18:21:05Z","updated_at":"2016-12-23T18:21:06Z","html_url":"https://github.com/django/django/pull/7727#discussion_r93791041","pull_request_url":"https://api.github.com/repos/django/django/pulls/7727","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/93791041"},"html":{"href":"https://github.com/django/django/pull/7727#discussion_r93791041"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/7727"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/7727","id":99164769,"html_url":"https://github.com/django/django/pull/7727","diff_url":"https://github.com/django/django/pull/7727.diff","patch_url":"https://github.com/django/django/pull/7727.patch","issue_url":"https://api.github.com/repos/django/django/issues/7727","number":7727,"state":"open","locked":false,"title":"[WIP] Added UNION/INTERSECT/EXCEPT support to the ORM","user":{"login":"apollo13","id":81547,"avatar_url":"https://avatars.githubusercontent.com/u/81547?v=3","gravatar_id":"","url":"https://api.github.com/users/apollo13","html_url":"https://github.com/apollo13","followers_url":"https://api.github.com/users/apollo13/followers","following_url":"https://api.github.com/users/apollo13/following{/other_user}","gists_url":"https://api.github.com/users/apollo13/gists{/gist_id}","starred_url":"https://api.github.com/users/apollo13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apollo13/subscriptions","organizations_url":"https://api.github.com/users/apollo13/orgs","repos_url":"https://api.github.com/users/apollo13/repos","events_url":"https://api.github.com/users/apollo13/events{/privacy}","received_events_url":"https://api.github.com/users/apollo13/received_events","type":"User","site_admin":false},"body":"This already seems to work quite well.\r\n\r\n * UNION/INTERSECT/EXCEPT + DISTINCT|ALL via .distinct on the resulting queryset\r\n * One can limit the resulting queryset as usual via [5:10] etc…\r\n * order_by does not yet work since it produces fully qualified names, I'd just need the numbers of the cols\r\n * Backend support is still missing (ie it assumes postgres syntax)","created_at":"2016-12-22T20:25:03Z","updated_at":"2016-12-23T18:21:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"059a5683088b92896f1e51c98c6972c526589a82","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/7727/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/7727/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/7727/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/0478b43b9bbcc6df042a51044cf5303e0fc92a11","head":{"label":"apollo13:union","ref":"union","sha":"0478b43b9bbcc6df042a51044cf5303e0fc92a11","user":{"login":"apollo13","id":81547,"avatar_url":"https://avatars.githubusercontent.com/u/81547?v=3","gravatar_id":"","url":"https://api.github.com/users/apollo13","html_url":"https://github.com/apollo13","followers_url":"https://api.github.com/users/apollo13/followers","following_url":"https://api.github.com/users/apollo13/following{/other_user}","gists_url":"https://api.github.com/users/apollo13/gists{/gist_id}","starred_url":"https://api.github.com/users/apollo13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apollo13/subscriptions","organizations_url":"https://api.github.com/users/apollo13/orgs","repos_url":"https://api.github.com/users/apollo13/repos","events_url":"https://api.github.com/users/apollo13/events{/privacy}","received_events_url":"https://api.github.com/users/apollo13/received_events","type":"User","site_admin":false},"repo":{"id":4217303,"name":"django","full_name":"apollo13/django","owner":{"login":"apollo13","id":81547,"avatar_url":"https://avatars.githubusercontent.com/u/81547?v=3","gravatar_id":"","url":"https://api.github.com/users/apollo13","html_url":"https://github.com/apollo13","followers_url":"https://api.github.com/users/apollo13/followers","following_url":"https://api.github.com/users/apollo13/following{/other_user}","gists_url":"https://api.github.com/users/apollo13/gists{/gist_id}","starred_url":"https://api.github.com/users/apollo13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apollo13/subscriptions","organizations_url":"https://api.github.com/users/apollo13/orgs","repos_url":"https://api.github.com/users/apollo13/repos","events_url":"https://api.github.com/users/apollo13/events{/privacy}","received_events_url":"https://api.github.com/users/apollo13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apollo13/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/apollo13/django","forks_url":"https://api.github.com/repos/apollo13/django/forks","keys_url":"https://api.github.com/repos/apollo13/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apollo13/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apollo13/django/teams","hooks_url":"https://api.github.com/repos/apollo13/django/hooks","issue_events_url":"https://api.github.com/repos/apollo13/django/issues/events{/number}","events_url":"https://api.github.com/repos/apollo13/django/events","assignees_url":"https://api.github.com/repos/apollo13/django/assignees{/user}","branches_url":"https://api.github.com/repos/apollo13/django/branches{/branch}","tags_url":"https://api.github.com/repos/apollo13/django/tags","blobs_url":"https://api.github.com/repos/apollo13/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apollo13/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apollo13/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/apollo13/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apollo13/django/statuses/{sha}","languages_url":"https://api.github.com/repos/apollo13/django/languages","stargazers_url":"https://api.github.com/repos/apollo13/django/stargazers","contributors_url":"https://api.github.com/repos/apollo13/django/contributors","subscribers_url":"https://api.github.com/repos/apollo13/django/subscribers","subscription_url":"https://api.github.com/repos/apollo13/django/subscription","commits_url":"https://api.github.com/repos/apollo13/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/apollo13/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/apollo13/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/apollo13/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/apollo13/django/contents/{+path}","compare_url":"https://api.github.com/repos/apollo13/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apollo13/django/merges","archive_url":"https://api.github.com/repos/apollo13/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apollo13/django/downloads","issues_url":"https://api.github.com/repos/apollo13/django/issues{/number}","pulls_url":"https://api.github.com/repos/apollo13/django/pulls{/number}","milestones_url":"https://api.github.com/repos/apollo13/django/milestones{/number}","notifications_url":"https://api.github.com/repos/apollo13/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apollo13/django/labels{/name}","releases_url":"https://api.github.com/repos/apollo13/django/releases{/id}","deployments_url":"https://api.github.com/repos/apollo13/django/deployments","created_at":"2012-05-03T18:35:02Z","updated_at":"2015-03-28T14:18:33Z","pushed_at":"2016-12-23T18:18:08Z","git_url":"git://github.com/apollo13/django.git","ssh_url":"git@github.com:apollo13/django.git","clone_url":"https://github.com/apollo13/django.git","svn_url":"https://github.com/apollo13/django","homepage":"http://www.djangoproject.com/","size":125849,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"da792400503265a80e5307f17e59b65ec88694aa","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","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,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","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},"private":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":"2016-12-23T17:39:57Z","pushed_at":"2016-12-23T18:19:25Z","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":155344,"stargazers_count":22762,"watchers_count":22762,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9196,"mirror_url":null,"open_issues_count":99,"forks":9196,"open_issues":99,"watchers":22762,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/7727"},"html":{"href":"https://github.com/django/django/pull/7727"},"issue":{"href":"https://api.github.com/repos/django/django/issues/7727"},"comments":{"href":"https://api.github.com/repos/django/django/issues/7727/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/7727/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/7727/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/0478b43b9bbcc6df042a51044cf5303e0fc92a11"}}}}
{"actor":{"display_login":"apollo13"}}