{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/189088253","pull_request_review_id":121200612,"id":189088253,"diff_hunk":"@@ -459,6 +473,18 @@ def get_registration_links_count(self, obj):\n                 count += 1\n         return count\n \n+    def get_linked_by_nodes_count(self, obj):\n+        return NodeRelation.objects.filter(child=obj, is_node_link=True).select_related('parent').exclude(parent__type='osf.collection').exclude(parent__type='osf.registration').count()","path":"api/nodes/serializers.py","position":53,"original_position":53,"commit_id":"defc1389f06659e47b703047ad51651444eaa096","original_commit_id":"defc1389f06659e47b703047ad51651444eaa096","user":{"login":"brianjgeiger","id":6599111,"avatar_url":"https://avatars1.githubusercontent.com/u/6599111?v=4","gravatar_id":"","url":"https://api.github.com/users/brianjgeiger","html_url":"https://github.com/brianjgeiger","followers_url":"https://api.github.com/users/brianjgeiger/followers","following_url":"https://api.github.com/users/brianjgeiger/following{/other_user}","gists_url":"https://api.github.com/users/brianjgeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/brianjgeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianjgeiger/subscriptions","organizations_url":"https://api.github.com/users/brianjgeiger/orgs","repos_url":"https://api.github.com/users/brianjgeiger/repos","events_url":"https://api.github.com/users/brianjgeiger/events{/privacy}","received_events_url":"https://api.github.com/users/brianjgeiger/received_events","type":"User","site_admin":false},"body":"I'm pretty sure, but am verifying with Product.","created_at":"2018-05-17T20:19:58Z","updated_at":"2018-05-17T20:19:58Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/8370#discussion_r189088253","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/189088253"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/8370#discussion_r189088253"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370"}},"in_reply_to_id":189036304},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370","id":188252976,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/8370","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/8370.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/8370.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8370","number":8370,"state":"open","locked":false,"title":"[EMB-277] Add linked-by relationships and templated_by_count attribute ","user":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars0.githubusercontent.com/u/6268982?v=4","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"body":"\r\n## Purpose\r\nAllow the v2 api to pass those counts and lists so that the analytics page can consume it.\r\n\r\n## Changes\r\nAdd a count of projects that use the viewed node as a template, and add relationships listing the nodes and registrations that have linked to the viewed node\r\nAdds:\r\n - `v2/nodes/<id>/linked_by_nodes`\r\n - `v2/nodes/<id>/linked_by_registrations`\r\n\r\n## Documentation\r\n- New attribute to node, new relationships\r\n\r\n## Ticket\r\nhttps://openscience.atlassian.net/browse/EMB-277\r\n","created_at":"2018-05-15T20:55:16Z","updated_at":"2018-05-17T20:19:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60a9ed383432447366f6f0e828c903f98048c5f0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8370/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/defc1389f06659e47b703047ad51651444eaa096","head":{"label":"hmoco:feature/linked-by","ref":"feature/linked-by","sha":"defc1389f06659e47b703047ad51651444eaa096","user":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars0.githubusercontent.com/u/6268982?v=4","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"repo":{"id":36302791,"name":"osf.io","full_name":"hmoco/osf.io","owner":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars0.githubusercontent.com/u/6268982?v=4","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hmoco/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/hmoco/osf.io","forks_url":"https://api.github.com/repos/hmoco/osf.io/forks","keys_url":"https://api.github.com/repos/hmoco/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmoco/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmoco/osf.io/teams","hooks_url":"https://api.github.com/repos/hmoco/osf.io/hooks","issue_events_url":"https://api.github.com/repos/hmoco/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/hmoco/osf.io/events","assignees_url":"https://api.github.com/repos/hmoco/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/hmoco/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/hmoco/osf.io/tags","blobs_url":"https://api.github.com/repos/hmoco/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmoco/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmoco/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmoco/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmoco/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/hmoco/osf.io/languages","stargazers_url":"https://api.github.com/repos/hmoco/osf.io/stargazers","contributors_url":"https://api.github.com/repos/hmoco/osf.io/contributors","subscribers_url":"https://api.github.com/repos/hmoco/osf.io/subscribers","subscription_url":"https://api.github.com/repos/hmoco/osf.io/subscription","commits_url":"https://api.github.com/repos/hmoco/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmoco/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmoco/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmoco/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmoco/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/hmoco/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmoco/osf.io/merges","archive_url":"https://api.github.com/repos/hmoco/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmoco/osf.io/downloads","issues_url":"https://api.github.com/repos/hmoco/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/hmoco/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/hmoco/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/hmoco/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmoco/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/hmoco/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/hmoco/osf.io/deployments","created_at":"2015-05-26T14:49:58Z","updated_at":"2017-02-10T20:46:04Z","pushed_at":"2018-05-17T15:21:38Z","git_url":"git://github.com/hmoco/osf.io.git","ssh_url":"git@github.com:hmoco/osf.io.git","clone_url":"https://github.com/hmoco/osf.io.git","svn_url":"https://github.com/hmoco/osf.io","homepage":"http://osf.io","size":171145,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"d3099309622458b9f85d87d328b1835f02f56fd3","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars1.githubusercontent.com/u/3344584?v=4","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars1.githubusercontent.com/u/3344584?v=4","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/deployments","created_at":"2013-05-21T15:53:37Z","updated_at":"2018-05-16T19:22:20Z","pushed_at":"2018-05-17T20:04:02Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"https://osf.io","size":170855,"stargazers_count":442,"watchers_count":442,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":244,"mirror_url":null,"archived":false,"open_issues_count":228,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":244,"open_issues":228,"watchers":442,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/8370"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8370"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8370/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8370/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/defc1389f06659e47b703047ad51651444eaa096"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"brianjgeiger"}}