{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/comments/46210451","id":46210451,"diff_hunk":"@@ -0,0 +1,113 @@\n+\"\"\"\n+API methods for module level data.\n+\"\"\"\n+from django.http import Http404\n+import re\n+from rest_framework.exceptions import ParseError\n+from rest_framework import generics\n+\n+from analytics_data_api.v0.models import RosterEntry\n+from analytics_data_api.v0.serializers import LearnerSerializer\n+\n+\n+class CourseViewMixin(object):\n+    \"\"\"\n+    Captures the course_id query arg and validates it.\n+    \"\"\"\n+\n+    COURSE_ID_PATTERN = r'(?P<course_id>[^/+]+[/+][^/+]+[/+][^/]+)'\n+    course_id = None\n+\n+    def get(self, request, *args, **kwargs):\n+        self.course_id = request.QUERY_PARAMS.get('course_id', None)","path":"analytics_data_api/v0/views/learners.py","position":22,"original_position":22,"commit_id":"c7dfc54997cd176285208f33bc489855eceeb441","original_commit_id":"c7dfc54997cd176285208f33bc489855eceeb441","user":{"login":"dsjen","id":5265058,"avatar_url":"https://avatars.githubusercontent.com/u/5265058?v=3","gravatar_id":"","url":"https://api.github.com/users/dsjen","html_url":"https://github.com/dsjen","followers_url":"https://api.github.com/users/dsjen/followers","following_url":"https://api.github.com/users/dsjen/following{/other_user}","gists_url":"https://api.github.com/users/dsjen/gists{/gist_id}","starred_url":"https://api.github.com/users/dsjen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsjen/subscriptions","organizations_url":"https://api.github.com/users/dsjen/orgs","repos_url":"https://api.github.com/users/dsjen/repos","events_url":"https://api.github.com/users/dsjen/events{/privacy}","received_events_url":"https://api.github.com/users/dsjen/received_events","type":"User","site_admin":false},"body":"Good idea!  Updated.","created_at":"2015-11-30T22:02:27Z","updated_at":"2015-11-30T22:02:27Z","html_url":"https://github.com/edx/edx-analytics-data-api/pull/88#discussion_r46210451","pull_request_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/comments/46210451"},"html":{"href":"https://github.com/edx/edx-analytics-data-api/pull/88#discussion_r46210451"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88","id":52150627,"html_url":"https://github.com/edx/edx-analytics-data-api/pull/88","diff_url":"https://github.com/edx/edx-analytics-data-api/pull/88.diff","patch_url":"https://github.com/edx/edx-analytics-data-api/pull/88.patch","issue_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/88","number":88,"state":"open","locked":false,"title":"Added learner details endpoint.","user":{"login":"dsjen","id":5265058,"avatar_url":"https://avatars.githubusercontent.com/u/5265058?v=3","gravatar_id":"","url":"https://api.github.com/users/dsjen","html_url":"https://github.com/dsjen","followers_url":"https://api.github.com/users/dsjen/followers","following_url":"https://api.github.com/users/dsjen/following{/other_user}","gists_url":"https://api.github.com/users/dsjen/gists{/gist_id}","starred_url":"https://api.github.com/users/dsjen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsjen/subscriptions","organizations_url":"https://api.github.com/users/dsjen/orgs","repos_url":"https://api.github.com/users/dsjen/repos","events_url":"https://api.github.com/users/dsjen/events{/privacy}","received_events_url":"https://api.github.com/users/dsjen/received_events","type":"User","site_admin":false},"body":"@mulby, @dan-f -- I've added the learner details endpoint. This PR incorporates elastic search and a stub for the learners list endpoint too.\r\n\r\nThere are a few entity and event fields that are a bit inconsistent between various specs and the real data, but they should be easy to update when we get aligned on the names.\r\n\r\nAlso, the path has updated here instead of /api/learner_analytics/v0/learners, it is now /api/v0/learners for both consistency and potential changes to the API recommendation.","created_at":"2015-11-30T17:02:48Z","updated_at":"2015-11-30T22:02:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"370bed7bdfa0450170db872cb1b36e652c3156fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88/commits","review_comments_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88/comments","review_comment_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/88/comments","statuses_url":"https://api.github.com/repos/edx/edx-analytics-data-api/statuses/c7dfc54997cd176285208f33bc489855eceeb441","head":{"label":"edx:dsjen/learner-list","ref":"dsjen/learner-list","sha":"c7dfc54997cd176285208f33bc489855eceeb441","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":20415476,"name":"edx-analytics-data-api","full_name":"edx/edx-analytics-data-api","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-analytics-data-api","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-analytics-data-api","forks_url":"https://api.github.com/repos/edx/edx-analytics-data-api/forks","keys_url":"https://api.github.com/repos/edx/edx-analytics-data-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-analytics-data-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-analytics-data-api/teams","hooks_url":"https://api.github.com/repos/edx/edx-analytics-data-api/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-analytics-data-api/events","assignees_url":"https://api.github.com/repos/edx/edx-analytics-data-api/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-analytics-data-api/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-analytics-data-api/tags","blobs_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-analytics-data-api/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-analytics-data-api/languages","stargazers_url":"https://api.github.com/repos/edx/edx-analytics-data-api/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-analytics-data-api/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-analytics-data-api/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-analytics-data-api/subscription","commits_url":"https://api.github.com/repos/edx/edx-analytics-data-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-analytics-data-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-analytics-data-api/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-analytics-data-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-analytics-data-api/merges","archive_url":"https://api.github.com/repos/edx/edx-analytics-data-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-analytics-data-api/downloads","issues_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-analytics-data-api/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-analytics-data-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-analytics-data-api/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-analytics-data-api/releases{/id}","created_at":"2014-06-02T18:55:15Z","updated_at":"2015-10-13T15:21:25Z","pushed_at":"2015-11-30T17:02:48Z","git_url":"git://github.com/edx/edx-analytics-data-api.git","ssh_url":"git@github.com:edx/edx-analytics-data-api.git","clone_url":"https://github.com/edx/edx-analytics-data-api.git","svn_url":"https://github.com/edx/edx-analytics-data-api","homepage":null,"size":1247,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":3,"forks":23,"open_issues":3,"watchers":5,"default_branch":"master"}},"base":{"label":"edx:learner-analytics","ref":"learner-analytics","sha":"5b5c792d50795d4a757f32f69bea8b7ccdf4f8d4","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":20415476,"name":"edx-analytics-data-api","full_name":"edx/edx-analytics-data-api","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-analytics-data-api","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-analytics-data-api","forks_url":"https://api.github.com/repos/edx/edx-analytics-data-api/forks","keys_url":"https://api.github.com/repos/edx/edx-analytics-data-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-analytics-data-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-analytics-data-api/teams","hooks_url":"https://api.github.com/repos/edx/edx-analytics-data-api/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-analytics-data-api/events","assignees_url":"https://api.github.com/repos/edx/edx-analytics-data-api/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-analytics-data-api/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-analytics-data-api/tags","blobs_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-analytics-data-api/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-analytics-data-api/languages","stargazers_url":"https://api.github.com/repos/edx/edx-analytics-data-api/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-analytics-data-api/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-analytics-data-api/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-analytics-data-api/subscription","commits_url":"https://api.github.com/repos/edx/edx-analytics-data-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-analytics-data-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-analytics-data-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-analytics-data-api/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-analytics-data-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-analytics-data-api/merges","archive_url":"https://api.github.com/repos/edx/edx-analytics-data-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-analytics-data-api/downloads","issues_url":"https://api.github.com/repos/edx/edx-analytics-data-api/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-analytics-data-api/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-analytics-data-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-analytics-data-api/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-analytics-data-api/releases{/id}","created_at":"2014-06-02T18:55:15Z","updated_at":"2015-10-13T15:21:25Z","pushed_at":"2015-11-30T17:02:48Z","git_url":"git://github.com/edx/edx-analytics-data-api.git","ssh_url":"git@github.com:edx/edx-analytics-data-api.git","clone_url":"https://github.com/edx/edx-analytics-data-api.git","svn_url":"https://github.com/edx/edx-analytics-data-api","homepage":null,"size":1247,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":3,"forks":23,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88"},"html":{"href":"https://github.com/edx/edx-analytics-data-api/pull/88"},"issue":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/88"},"comments":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-analytics-data-api/statuses/c7dfc54997cd176285208f33bc489855eceeb441"}}}}