{"action":"created","comment":{"url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/comments/32521813","id":32521813,"diff_hunk":"@@ -1,12 +1,22 @@\n __author__ = 'dmorina, asmita, megha'\n-\n from crowdsourcing.serializers.requester import *\n+from crowdsourcing.serializers.project import *\n from rest_framework import viewsets\n-\n+from rest_framework.decorators import detail_route\n+from rest_framework.response import Response\n+from crowdsourcing.models import Module\n class RequesterViewSet(viewsets.ModelViewSet):\n     from crowdsourcing.models import Requester\n     queryset = Requester.objects.all()\n     serializer_class = RequesterSerializer\n+    @detail_route(methods = ['GET'])\n+    def portfolio(self, request, *args, **kwargs):\n+        requester = self.get_object()\n+        modules = requester.module_set.all().filter(deleted=False,status=4)\n+        serializer = ModuleSerializer(modules,many = True,fields = ('id', 'name', 'icon', 'project', 'categories',","path":"crowdsourcing/viewsets/requester.py","position":null,"original_position":18,"commit_id":"693e02d39b773ebec78ff3181d4607e82f1a1d3d","original_commit_id":"8d97a8a398d21b7093b049fccb9b8946c29a104c","user":{"login":"Macbull","id":11361002,"avatar_url":"https://avatars.githubusercontent.com/u/11361002?v=3","gravatar_id":"","url":"https://api.github.com/users/Macbull","html_url":"https://github.com/Macbull","followers_url":"https://api.github.com/users/Macbull/followers","following_url":"https://api.github.com/users/Macbull/following{/other_user}","gists_url":"https://api.github.com/users/Macbull/gists{/gist_id}","starred_url":"https://api.github.com/users/Macbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Macbull/subscriptions","organizations_url":"https://api.github.com/users/Macbull/orgs","repos_url":"https://api.github.com/users/Macbull/repos","events_url":"https://api.github.com/users/Macbull/events{/privacy}","received_events_url":"https://api.github.com/users/Macbull/received_events","type":"User","site_admin":false},"body":"ohh! didn't expected it to work for many = true ! :D fixed it ! thanks","created_at":"2015-06-16T13:48:00Z","updated_at":"2015-06-16T13:48:00Z","html_url":"https://github.com/crowdresearch/crowdsource-platform/pull/268#discussion_r32521813","pull_request_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268","_links":{"self":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/comments/32521813"},"html":{"href":"https://github.com/crowdresearch/crowdsource-platform/pull/268#discussion_r32521813"},"pull_request":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268"}}},"pull_request":{"url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268","id":37649835,"html_url":"https://github.com/crowdresearch/crowdsource-platform/pull/268","diff_url":"https://github.com/crowdresearch/crowdsource-platform/pull/268.diff","patch_url":"https://github.com/crowdresearch/crowdsource-platform/pull/268.patch","issue_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/268","number":268,"state":"open","locked":false,"title":"Requester portfolio backend  ","user":{"login":"Macbull","id":11361002,"avatar_url":"https://avatars.githubusercontent.com/u/11361002?v=3","gravatar_id":"","url":"https://api.github.com/users/Macbull","html_url":"https://github.com/Macbull","followers_url":"https://api.github.com/users/Macbull/followers","following_url":"https://api.github.com/users/Macbull/following{/other_user}","gists_url":"https://api.github.com/users/Macbull/gists{/gist_id}","starred_url":"https://api.github.com/users/Macbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Macbull/subscriptions","organizations_url":"https://api.github.com/users/Macbull/orgs","repos_url":"https://api.github.com/users/Macbull/repos","events_url":"https://api.github.com/users/Macbull/events{/privacy}","received_events_url":"https://api.github.com/users/Macbull/received_events","type":"User","site_admin":false},"body":"Some improvements to PR #262 .\r\n\r\n1. Some of the serialisers are made dynamic, i.e. they now also accepts 'fields' argument. So that only relevant fields are included in response.\r\n2. Now, portfolio will be requested from requester viewset, instead of module viewset .\r\n\r\n#66 #65 #64 \r\n","created_at":"2015-06-14T22:34:21Z","updated_at":"2015-06-16T13:48:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eef193d00ab92d161a463e626ee50bf19e24a184","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268/commits","review_comments_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268/comments","review_comment_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/268/comments","statuses_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/statuses/693e02d39b773ebec78ff3181d4607e82f1a1d3d","head":{"label":"Macbull:requester_portfolio_front","ref":"requester_portfolio_front","sha":"693e02d39b773ebec78ff3181d4607e82f1a1d3d","user":{"login":"Macbull","id":11361002,"avatar_url":"https://avatars.githubusercontent.com/u/11361002?v=3","gravatar_id":"","url":"https://api.github.com/users/Macbull","html_url":"https://github.com/Macbull","followers_url":"https://api.github.com/users/Macbull/followers","following_url":"https://api.github.com/users/Macbull/following{/other_user}","gists_url":"https://api.github.com/users/Macbull/gists{/gist_id}","starred_url":"https://api.github.com/users/Macbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Macbull/subscriptions","organizations_url":"https://api.github.com/users/Macbull/orgs","repos_url":"https://api.github.com/users/Macbull/repos","events_url":"https://api.github.com/users/Macbull/events{/privacy}","received_events_url":"https://api.github.com/users/Macbull/received_events","type":"User","site_admin":false},"repo":{"id":36275931,"name":"crowdsource-platform","full_name":"Macbull/crowdsource-platform","owner":{"login":"Macbull","id":11361002,"avatar_url":"https://avatars.githubusercontent.com/u/11361002?v=3","gravatar_id":"","url":"https://api.github.com/users/Macbull","html_url":"https://github.com/Macbull","followers_url":"https://api.github.com/users/Macbull/followers","following_url":"https://api.github.com/users/Macbull/following{/other_user}","gists_url":"https://api.github.com/users/Macbull/gists{/gist_id}","starred_url":"https://api.github.com/users/Macbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Macbull/subscriptions","organizations_url":"https://api.github.com/users/Macbull/orgs","repos_url":"https://api.github.com/users/Macbull/repos","events_url":"https://api.github.com/users/Macbull/events{/privacy}","received_events_url":"https://api.github.com/users/Macbull/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Macbull/crowdsource-platform","description":"The main repository for Crowdsource Platform","fork":true,"url":"https://api.github.com/repos/Macbull/crowdsource-platform","forks_url":"https://api.github.com/repos/Macbull/crowdsource-platform/forks","keys_url":"https://api.github.com/repos/Macbull/crowdsource-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Macbull/crowdsource-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Macbull/crowdsource-platform/teams","hooks_url":"https://api.github.com/repos/Macbull/crowdsource-platform/hooks","issue_events_url":"https://api.github.com/repos/Macbull/crowdsource-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Macbull/crowdsource-platform/events","assignees_url":"https://api.github.com/repos/Macbull/crowdsource-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Macbull/crowdsource-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Macbull/crowdsource-platform/tags","blobs_url":"https://api.github.com/repos/Macbull/crowdsource-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Macbull/crowdsource-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Macbull/crowdsource-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Macbull/crowdsource-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Macbull/crowdsource-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Macbull/crowdsource-platform/languages","stargazers_url":"https://api.github.com/repos/Macbull/crowdsource-platform/stargazers","contributors_url":"https://api.github.com/repos/Macbull/crowdsource-platform/contributors","subscribers_url":"https://api.github.com/repos/Macbull/crowdsource-platform/subscribers","subscription_url":"https://api.github.com/repos/Macbull/crowdsource-platform/subscription","commits_url":"https://api.github.com/repos/Macbull/crowdsource-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Macbull/crowdsource-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Macbull/crowdsource-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Macbull/crowdsource-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Macbull/crowdsource-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Macbull/crowdsource-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Macbull/crowdsource-platform/merges","archive_url":"https://api.github.com/repos/Macbull/crowdsource-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Macbull/crowdsource-platform/downloads","issues_url":"https://api.github.com/repos/Macbull/crowdsource-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Macbull/crowdsource-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Macbull/crowdsource-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Macbull/crowdsource-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Macbull/crowdsource-platform/labels{/name}","releases_url":"https://api.github.com/repos/Macbull/crowdsource-platform/releases{/id}","created_at":"2015-05-26T06:10:01Z","updated_at":"2015-05-26T06:10:02Z","pushed_at":"2015-06-16T13:47:26Z","git_url":"git://github.com/Macbull/crowdsource-platform.git","ssh_url":"git@github.com:Macbull/crowdsource-platform.git","clone_url":"https://github.com/Macbull/crowdsource-platform.git","svn_url":"https://github.com/Macbull/crowdsource-platform","homepage":null,"size":10338,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"develop2"}},"base":{"label":"crowdresearch:develop2","ref":"develop2","sha":"e5853eaa6502c807324794fc884bced19d745a8b","user":{"login":"crowdresearch","id":11791223,"avatar_url":"https://avatars.githubusercontent.com/u/11791223?v=3","gravatar_id":"","url":"https://api.github.com/users/crowdresearch","html_url":"https://github.com/crowdresearch","followers_url":"https://api.github.com/users/crowdresearch/followers","following_url":"https://api.github.com/users/crowdresearch/following{/other_user}","gists_url":"https://api.github.com/users/crowdresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/crowdresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowdresearch/subscriptions","organizations_url":"https://api.github.com/users/crowdresearch/orgs","repos_url":"https://api.github.com/users/crowdresearch/repos","events_url":"https://api.github.com/users/crowdresearch/events{/privacy}","received_events_url":"https://api.github.com/users/crowdresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":34006010,"name":"crowdsource-platform","full_name":"crowdresearch/crowdsource-platform","owner":{"login":"crowdresearch","id":11791223,"avatar_url":"https://avatars.githubusercontent.com/u/11791223?v=3","gravatar_id":"","url":"https://api.github.com/users/crowdresearch","html_url":"https://github.com/crowdresearch","followers_url":"https://api.github.com/users/crowdresearch/followers","following_url":"https://api.github.com/users/crowdresearch/following{/other_user}","gists_url":"https://api.github.com/users/crowdresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/crowdresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowdresearch/subscriptions","organizations_url":"https://api.github.com/users/crowdresearch/orgs","repos_url":"https://api.github.com/users/crowdresearch/repos","events_url":"https://api.github.com/users/crowdresearch/events{/privacy}","received_events_url":"https://api.github.com/users/crowdresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowdresearch/crowdsource-platform","description":"The main repository for Crowdsource Platform","fork":false,"url":"https://api.github.com/repos/crowdresearch/crowdsource-platform","forks_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/forks","keys_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/teams","hooks_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/hooks","issue_events_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/events{/number}","events_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/events","assignees_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/assignees{/user}","branches_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/branches{/branch}","tags_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/tags","blobs_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/languages","stargazers_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/stargazers","contributors_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/contributors","subscribers_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/subscribers","subscription_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/subscription","commits_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/contents/{+path}","compare_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/merges","archive_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/downloads","issues_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues{/number}","pulls_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/labels{/name}","releases_url":"https://api.github.com/repos/crowdresearch/crowdsource-platform/releases{/id}","created_at":"2015-04-15T16:36:52Z","updated_at":"2015-06-08T12:49:29Z","pushed_at":"2015-06-16T13:47:27Z","git_url":"git://github.com/crowdresearch/crowdsource-platform.git","ssh_url":"git@github.com:crowdresearch/crowdsource-platform.git","clone_url":"https://github.com/crowdresearch/crowdsource-platform.git","svn_url":"https://github.com/crowdresearch/crowdsource-platform","homepage":null,"size":26133,"stargazers_count":32,"watchers_count":32,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":64,"forks":105,"open_issues":64,"watchers":32,"default_branch":"develop2"}},"_links":{"self":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268"},"html":{"href":"https://github.com/crowdresearch/crowdsource-platform/pull/268"},"issue":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/268"},"comments":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/issues/268/comments"},"review_comments":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268/comments"},"review_comment":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/pulls/268/commits"},"statuses":{"href":"https://api.github.com/repos/crowdresearch/crowdsource-platform/statuses/693e02d39b773ebec78ff3181d4607e82f1a1d3d"}}}}