{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-server/pulls/comments/56624706","id":56624706,"diff_hunk":"@@ -454,18 +454,31 @@ def contributions_series(request, addon, group, start, end, format):\n     qs = (Contribution.objects.extra(select={'date_created': 'date(created)'})\n           .filter(addon=addon, amount__gt=0, transaction_id__isnull=False,\n                   created__range=date_range)\n-          .values('date_created')\n-          .annotate(count=Count('amount'), average=Avg('amount'),\n-                    total=Sum('amount')))\n+          .values('date_created', 'currency')\n+          .annotate(count=Count('amount'), total=Sum('amount')))\n \n-    # Add `date` and `end` keys for legacy compat.\n-    series = sorted(qs, key=lambda x: x['date_created'], reverse=True)\n-    for row in series:\n-        row['end'] = row['date'] = row.pop('date_created')\n+    series = []\n+    currencies = set()\n+    last = None\n+    for row in sorted(qs, key=lambda x: x['date_created'], reverse=True):","path":"src/olympia/stats/views.py","position":26,"original_position":26,"commit_id":"020a686d7ee83bd40cd860818eb3a09203ab4194","original_commit_id":"020a686d7ee83bd40cd860818eb3a09203ab4194","user":{"login":"darktrojan","id":1540303,"avatar_url":"https://avatars.githubusercontent.com/u/1540303?v=3","gravatar_id":"","url":"https://api.github.com/users/darktrojan","html_url":"https://github.com/darktrojan","followers_url":"https://api.github.com/users/darktrojan/followers","following_url":"https://api.github.com/users/darktrojan/following{/other_user}","gists_url":"https://api.github.com/users/darktrojan/gists{/gist_id}","starred_url":"https://api.github.com/users/darktrojan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darktrojan/subscriptions","organizations_url":"https://api.github.com/users/darktrojan/orgs","repos_url":"https://api.github.com/users/darktrojan/repos","events_url":"https://api.github.com/users/darktrojan/events{/privacy}","received_events_url":"https://api.github.com/users/darktrojan/received_events","type":"User","site_admin":false},"body":"Good point. I just borrowed it from the old code without thinking about it too much.","created_at":"2016-03-18T08:26:23Z","updated_at":"2016-03-18T08:26:23Z","html_url":"https://github.com/mozilla/addons-server/pull/1864#discussion_r56624706","pull_request_url":"https://api.github.com/repos/mozilla/addons-server/pulls/1864","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/comments/56624706"},"html":{"href":"https://github.com/mozilla/addons-server/pull/1864#discussion_r56624706"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/1864"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-server/pulls/1864","id":62199062,"html_url":"https://github.com/mozilla/addons-server/pull/1864","diff_url":"https://github.com/mozilla/addons-server/pull/1864.diff","patch_url":"https://github.com/mozilla/addons-server/pull/1864.patch","issue_url":"https://api.github.com/repos/mozilla/addons-server/issues/1864","number":1864,"state":"open","locked":false,"title":"Allow for contributions in currencies other than USD","user":{"login":"darktrojan","id":1540303,"avatar_url":"https://avatars.githubusercontent.com/u/1540303?v=3","gravatar_id":"","url":"https://api.github.com/users/darktrojan","html_url":"https://github.com/darktrojan","followers_url":"https://api.github.com/users/darktrojan/followers","following_url":"https://api.github.com/users/darktrojan/following{/other_user}","gists_url":"https://api.github.com/users/darktrojan/gists{/gist_id}","starred_url":"https://api.github.com/users/darktrojan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darktrojan/subscriptions","organizations_url":"https://api.github.com/users/darktrojan/orgs","repos_url":"https://api.github.com/users/darktrojan/repos","events_url":"https://api.github.com/users/darktrojan/events{/privacy}","received_events_url":"https://api.github.com/users/darktrojan/received_events","type":"User","site_admin":false},"body":"This isn't ready by any means, but I wanted to get some opinions on it. I'm storing the contribution amount in the original currency, plus the equivalent in USD, since everything currently expects a USD value.","created_at":"2016-03-09T09:15:40Z","updated_at":"2016-03-18T08:26:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c680354799c193a3b41ca0facb567c36a9b30caf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-server/pulls/1864/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-server/pulls/1864/comments","review_comment_url":"https://api.github.com/repos/mozilla/addons-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/addons-server/issues/1864/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-server/statuses/020a686d7ee83bd40cd860818eb3a09203ab4194","head":{"label":"darktrojan:currency","ref":"currency","sha":"020a686d7ee83bd40cd860818eb3a09203ab4194","user":{"login":"darktrojan","id":1540303,"avatar_url":"https://avatars.githubusercontent.com/u/1540303?v=3","gravatar_id":"","url":"https://api.github.com/users/darktrojan","html_url":"https://github.com/darktrojan","followers_url":"https://api.github.com/users/darktrojan/followers","following_url":"https://api.github.com/users/darktrojan/following{/other_user}","gists_url":"https://api.github.com/users/darktrojan/gists{/gist_id}","starred_url":"https://api.github.com/users/darktrojan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darktrojan/subscriptions","organizations_url":"https://api.github.com/users/darktrojan/orgs","repos_url":"https://api.github.com/users/darktrojan/repos","events_url":"https://api.github.com/users/darktrojan/events{/privacy}","received_events_url":"https://api.github.com/users/darktrojan/received_events","type":"User","site_admin":false},"repo":{"id":43583758,"name":"addons-server","full_name":"darktrojan/addons-server","owner":{"login":"darktrojan","id":1540303,"avatar_url":"https://avatars.githubusercontent.com/u/1540303?v=3","gravatar_id":"","url":"https://api.github.com/users/darktrojan","html_url":"https://github.com/darktrojan","followers_url":"https://api.github.com/users/darktrojan/followers","following_url":"https://api.github.com/users/darktrojan/following{/other_user}","gists_url":"https://api.github.com/users/darktrojan/gists{/gist_id}","starred_url":"https://api.github.com/users/darktrojan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darktrojan/subscriptions","organizations_url":"https://api.github.com/users/darktrojan/orgs","repos_url":"https://api.github.com/users/darktrojan/repos","events_url":"https://api.github.com/users/darktrojan/events{/privacy}","received_events_url":"https://api.github.com/users/darktrojan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darktrojan/addons-server","description":"addons.mozilla.org, reloaded.","fork":true,"url":"https://api.github.com/repos/darktrojan/addons-server","forks_url":"https://api.github.com/repos/darktrojan/addons-server/forks","keys_url":"https://api.github.com/repos/darktrojan/addons-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darktrojan/addons-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darktrojan/addons-server/teams","hooks_url":"https://api.github.com/repos/darktrojan/addons-server/hooks","issue_events_url":"https://api.github.com/repos/darktrojan/addons-server/issues/events{/number}","events_url":"https://api.github.com/repos/darktrojan/addons-server/events","assignees_url":"https://api.github.com/repos/darktrojan/addons-server/assignees{/user}","branches_url":"https://api.github.com/repos/darktrojan/addons-server/branches{/branch}","tags_url":"https://api.github.com/repos/darktrojan/addons-server/tags","blobs_url":"https://api.github.com/repos/darktrojan/addons-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darktrojan/addons-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darktrojan/addons-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/darktrojan/addons-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darktrojan/addons-server/statuses/{sha}","languages_url":"https://api.github.com/repos/darktrojan/addons-server/languages","stargazers_url":"https://api.github.com/repos/darktrojan/addons-server/stargazers","contributors_url":"https://api.github.com/repos/darktrojan/addons-server/contributors","subscribers_url":"https://api.github.com/repos/darktrojan/addons-server/subscribers","subscription_url":"https://api.github.com/repos/darktrojan/addons-server/subscription","commits_url":"https://api.github.com/repos/darktrojan/addons-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/darktrojan/addons-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/darktrojan/addons-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/darktrojan/addons-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/darktrojan/addons-server/contents/{+path}","compare_url":"https://api.github.com/repos/darktrojan/addons-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darktrojan/addons-server/merges","archive_url":"https://api.github.com/repos/darktrojan/addons-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darktrojan/addons-server/downloads","issues_url":"https://api.github.com/repos/darktrojan/addons-server/issues{/number}","pulls_url":"https://api.github.com/repos/darktrojan/addons-server/pulls{/number}","milestones_url":"https://api.github.com/repos/darktrojan/addons-server/milestones{/number}","notifications_url":"https://api.github.com/repos/darktrojan/addons-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darktrojan/addons-server/labels{/name}","releases_url":"https://api.github.com/repos/darktrojan/addons-server/releases{/id}","deployments_url":"https://api.github.com/repos/darktrojan/addons-server/deployments","created_at":"2015-10-03T01:23:21Z","updated_at":"2016-03-04T01:16:46Z","pushed_at":"2016-03-17T22:15:30Z","git_url":"git://github.com/darktrojan/addons-server.git","ssh_url":"git@github.com:darktrojan/addons-server.git","clone_url":"https://github.com/darktrojan/addons-server.git","svn_url":"https://github.com/darktrojan/addons-server","homepage":"https://addons.mozilla.org/","size":470735,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"21e2420992dacbde065e8ae87950eb3f05ebbf63","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":16416867,"name":"addons-server","full_name":"mozilla/addons-server","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/addons-server","description":"addons.mozilla.org Django app","fork":false,"url":"https://api.github.com/repos/mozilla/addons-server","forks_url":"https://api.github.com/repos/mozilla/addons-server/forks","keys_url":"https://api.github.com/repos/mozilla/addons-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-server/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-server/events","assignees_url":"https://api.github.com/repos/mozilla/addons-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-server/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-server/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-server/merges","archive_url":"https://api.github.com/repos/mozilla/addons-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-server/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-server/deployments","created_at":"2014-01-31T18:44:15Z","updated_at":"2016-03-15T16:30:55Z","pushed_at":"2016-03-18T07:58:53Z","git_url":"git://github.com/mozilla/addons-server.git","ssh_url":"git@github.com:mozilla/addons-server.git","clone_url":"https://github.com/mozilla/addons-server.git","svn_url":"https://github.com/mozilla/addons-server","homepage":"https://addons.mozilla.org/","size":480233,"stargazers_count":82,"watchers_count":82,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":143,"mirror_url":null,"open_issues_count":201,"forks":143,"open_issues":201,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/1864"},"html":{"href":"https://github.com/mozilla/addons-server/pull/1864"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-server/issues/1864"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-server/issues/1864/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/1864/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/addons-server/pulls/1864/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-server/statuses/020a686d7ee83bd40cd860818eb3a09203ab4194"}}}}