{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/23010501","id":23010501,"diff_hunk":"@@ -90,22 +90,25 @@ def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize\n         clause, _ = query._add_q(self, reuse, allow_joins=allow_joins)\n         return clause\n \n-    def refs_aggregate(self, existing_aggregates):\n-        def _refs_aggregate(obj, existing_aggregates):\n-            if not isinstance(obj, tree.Node):\n-                aggregate, aggregate_lookups = refs_aggregate(obj[0].split(LOOKUP_SEP), existing_aggregates)\n+    @classmethod\n+    def _refs_aggregate(cls, obj, existing_aggregates):\n+        if not isinstance(obj, tree.Node):\n+            aggregate, aggregate_lookups = refs_aggregate(obj[0].split(LOOKUP_SEP), existing_aggregates)\n+            if not aggregate:\n                 if not aggregate and hasattr(obj[1], 'refs_aggregate'):","path":"django/db/models/query_utils.py","position":13,"original_position":13,"commit_id":"127a0f2d6250a33c32a898a90a9c0558aeacfc9c","original_commit_id":"127a0f2d6250a33c32a898a90a9c0558aeacfc9c","user":{"login":"michalmo","id":9825131,"avatar_url":"https://avatars.githubusercontent.com/u/9825131?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmo","html_url":"https://github.com/michalmo","followers_url":"https://api.github.com/users/michalmo/followers","following_url":"https://api.github.com/users/michalmo/following{/other_user}","gists_url":"https://api.github.com/users/michalmo/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmo/subscriptions","organizations_url":"https://api.github.com/users/michalmo/orgs","repos_url":"https://api.github.com/users/michalmo/repos","events_url":"https://api.github.com/users/michalmo/events{/privacy}","received_events_url":"https://api.github.com/users/michalmo/received_events","type":"User","site_admin":false},"body":"not aggregate is tested twice","created_at":"2015-01-15T14:00:34Z","updated_at":"2015-01-15T14:00:34Z","html_url":"https://github.com/django/django/pull/3905#discussion_r23010501","pull_request_url":"https://api.github.com/repos/django/django/pulls/3905","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/23010501"},"html":{"href":"https://github.com/django/django/pull/3905#discussion_r23010501"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/3905"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/3905","id":27240342,"html_url":"https://github.com/django/django/pull/3905","diff_url":"https://github.com/django/django/pull/3905.diff","patch_url":"https://github.com/django/django/pull/3905.patch","issue_url":"https://api.github.com/repos/django/django/issues/3905","number":3905,"state":"open","locked":false,"title":"Replaced inner functions by class methods.","user":{"login":"charettes","id":9293,"avatar_url":"https://avatars.githubusercontent.com/u/9293?v=3","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":"refs #24031","created_at":"2015-01-13T00:57:37Z","updated_at":"2015-01-15T14:00:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caf7e1366e9744b5cba5a4ea5d8dfd40d0b3dae4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/3905/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/3905/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments/{number}","comments_url":"https://api.github.com/repos/django/django/issues/3905/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/127a0f2d6250a33c32a898a90a9c0558aeacfc9c","head":{"label":"charettes:ticket-24031-avoid-func-creation","ref":"ticket-24031-avoid-func-creation","sha":"127a0f2d6250a33c32a898a90a9c0558aeacfc9c","user":{"login":"charettes","id":9293,"avatar_url":"https://avatars.githubusercontent.com/u/9293?v=3","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},"repo":{"id":4164938,"name":"django","full_name":"charettes/django","owner":{"login":"charettes","id":9293,"avatar_url":"https://avatars.githubusercontent.com/u/9293?v=3","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},"private":false,"html_url":"https://github.com/charettes/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/charettes/django","forks_url":"https://api.github.com/repos/charettes/django/forks","keys_url":"https://api.github.com/repos/charettes/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charettes/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charettes/django/teams","hooks_url":"https://api.github.com/repos/charettes/django/hooks","issue_events_url":"https://api.github.com/repos/charettes/django/issues/events{/number}","events_url":"https://api.github.com/repos/charettes/django/events","assignees_url":"https://api.github.com/repos/charettes/django/assignees{/user}","branches_url":"https://api.github.com/repos/charettes/django/branches{/branch}","tags_url":"https://api.github.com/repos/charettes/django/tags","blobs_url":"https://api.github.com/repos/charettes/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charettes/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charettes/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/charettes/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charettes/django/statuses/{sha}","languages_url":"https://api.github.com/repos/charettes/django/languages","stargazers_url":"https://api.github.com/repos/charettes/django/stargazers","contributors_url":"https://api.github.com/repos/charettes/django/contributors","subscribers_url":"https://api.github.com/repos/charettes/django/subscribers","subscription_url":"https://api.github.com/repos/charettes/django/subscription","commits_url":"https://api.github.com/repos/charettes/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/charettes/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/charettes/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/charettes/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/charettes/django/contents/{+path}","compare_url":"https://api.github.com/repos/charettes/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charettes/django/merges","archive_url":"https://api.github.com/repos/charettes/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charettes/django/downloads","issues_url":"https://api.github.com/repos/charettes/django/issues{/number}","pulls_url":"https://api.github.com/repos/charettes/django/pulls{/number}","milestones_url":"https://api.github.com/repos/charettes/django/milestones{/number}","notifications_url":"https://api.github.com/repos/charettes/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charettes/django/labels{/name}","releases_url":"https://api.github.com/repos/charettes/django/releases{/id}","created_at":"2012-04-28T04:23:16Z","updated_at":"2014-06-01T14:49:26Z","pushed_at":"2015-01-14T19:46:43Z","git_url":"git://github.com/charettes/django.git","ssh_url":"git@github.com:charettes/django.git","clone_url":"https://github.com/charettes/django.git","svn_url":"https://github.com/charettes/django","homepage":"http://www.djangoproject.com/","size":90535,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"28308078f397d1de36fd0da417ac7da2544ba12d","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}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-01-15T12:00:22Z","pushed_at":"2015-01-15T08:32:53Z","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":246706,"stargazers_count":12568,"watchers_count":12568,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4919,"mirror_url":null,"open_issues_count":73,"forks":4919,"open_issues":73,"watchers":12568,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/3905"},"html":{"href":"https://github.com/django/django/pull/3905"},"issue":{"href":"https://api.github.com/repos/django/django/issues/3905"},"comments":{"href":"https://api.github.com/repos/django/django/issues/3905/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/3905/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/3905/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/127a0f2d6250a33c32a898a90a9c0558aeacfc9c"}}}}