{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/76545021","id":76545021,"diff_hunk":"@@ -75,7 +75,7 @@ def main():\n         # the 'children' field for every subject\n         logger.info('Setting \"children\" field for each Subject')\n         for subject in Subject.find():\n-            subject.set_children()\n+            subject.children = Subject.find(Q('parents', 'eq', subject))","path":"scripts/update_taxonomies.py","position":null,"original_position":5,"commit_id":"266b1a5e4b69cd8b2bd82e973b59b58bc433bbee","original_commit_id":"266b1a5e4b69cd8b2bd82e973b59b58bc433bbee","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2016-08-29T01:47:24Z","updated_at":"2016-08-29T01:47:24Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/6238#discussion_r76545021","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/76545021"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/6238#discussion_r76545021"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238","id":83033800,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/6238","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/6238.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/6238.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/6238","number":6238,"state":"open","locked":false,"title":"[Hotfix] Save children","user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"body":"## Purpose\r\nUpdates #6237 \r\n\r\n## Changes\r\nFrom parent PR:\r\n>- add child count to the taxonomies serializer (added here in attributes instead of in extra for simplicity when reading from ember for speed sake)\r\n- add child_count property to Subjects\r\n- add children as foreign field to Subjects cause why not be proper\r\n- use update_taxonomies script to also set the children\r\n- update preprints realted views with caveat message\r\n\r\n* minor update to model / script\r\n\r\n## Side effects\r\n>Must run update_taxonomies again to make sure all children are saved, orelse all children counts will be 0\r\nAn ember-osf PR will rely on this to get accurate carrts or not","created_at":"2016-08-29T01:15:14Z","updated_at":"2016-08-29T01:47:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8acdcf451cc9b63390647ad92357b83d67e3cae6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238/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/6238/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/266b1a5e4b69cd8b2bd82e973b59b58bc433bbee","head":{"label":"mfraezz:hotfix/subject-children","ref":"hotfix/subject-children","sha":"266b1a5e4b69cd8b2bd82e973b59b58bc433bbee","user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"repo":{"id":26929858,"name":"osf.io","full_name":"mfraezz/osf.io","owner":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfraezz/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/mfraezz/osf.io","forks_url":"https://api.github.com/repos/mfraezz/osf.io/forks","keys_url":"https://api.github.com/repos/mfraezz/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfraezz/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfraezz/osf.io/teams","hooks_url":"https://api.github.com/repos/mfraezz/osf.io/hooks","issue_events_url":"https://api.github.com/repos/mfraezz/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/mfraezz/osf.io/events","assignees_url":"https://api.github.com/repos/mfraezz/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/mfraezz/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/mfraezz/osf.io/tags","blobs_url":"https://api.github.com/repos/mfraezz/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfraezz/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfraezz/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfraezz/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfraezz/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/mfraezz/osf.io/languages","stargazers_url":"https://api.github.com/repos/mfraezz/osf.io/stargazers","contributors_url":"https://api.github.com/repos/mfraezz/osf.io/contributors","subscribers_url":"https://api.github.com/repos/mfraezz/osf.io/subscribers","subscription_url":"https://api.github.com/repos/mfraezz/osf.io/subscription","commits_url":"https://api.github.com/repos/mfraezz/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfraezz/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfraezz/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfraezz/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfraezz/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/mfraezz/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfraezz/osf.io/merges","archive_url":"https://api.github.com/repos/mfraezz/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfraezz/osf.io/downloads","issues_url":"https://api.github.com/repos/mfraezz/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/mfraezz/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/mfraezz/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/mfraezz/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfraezz/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/mfraezz/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/mfraezz/osf.io/deployments","created_at":"2014-11-20T20:12:10Z","updated_at":"2015-01-28T20:39:13Z","pushed_at":"2016-08-29T01:10:32Z","git_url":"git://github.com/mfraezz/osf.io.git","ssh_url":"git@github.com:mfraezz/osf.io.git","clone_url":"https://github.com/mfraezz/osf.io.git","svn_url":"https://github.com/mfraezz/osf.io","homepage":"http://osf.io","size":133468,"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":"develop"}},"base":{"label":"CenterForOpenScience:master","ref":"master","sha":"6247069fd0bb1e080c8659ef1002e55ad73ef713","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","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://avatars.githubusercontent.com/u/3344584?v=3","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":"2016-08-27T20:23:17Z","pushed_at":"2016-08-29T01:29:21Z","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":"http://osf.io","size":267495,"stargazers_count":253,"watchers_count":253,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":215,"forks":198,"open_issues":215,"watchers":253,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/6238"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/6238"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/6238/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/6238/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/6238/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/266b1a5e4b69cd8b2bd82e973b59b58bc433bbee"}}}}
{"actor":{"display_login":"sloria"}}