{"action":"created","comment":{"url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/comments/36518768","id":36518768,"diff_hunk":"@@ -0,0 +1,85 @@\n+import re\n+import urlparse\n+\n+\n+from django.shortcuts import render\n+from django.core.validators import URLValidator\n+from django.core.exceptions import ValidationError\n+\n+from rest_framework import viewsets\n+from rest_framework.decorators import api_view, permission_classes\n+from rest_framework.permissions import AllowAny\n+from rest_framework import renderers\n+from rest_framework import pagination\n+from rest_framework import viewsets\n+from rest_framework import request\n+from rest_framework.decorators import detail_route, list_route\n+from rest_framework.response import Response\n+from rest_framework.pagination import PageNumberPagination\n+\n+from segmentsconfigapp.models import SegmentsConfig\n+from segmentsconfigapp.serializers import SegmentsConfigSerializer\n+from segmentsconfigapp.parser import ParserSegmentConfig\n+\n+class SegmentsConfigSetPagination(PageNumberPagination):\n+    page_size = 5\n+    page_size_query_param = 'page_size'\n+    max_page_size = 1000\n+\n+@permission_classes((AllowAny, ))\n+class SegmentsConfigViewSet(viewsets.ModelViewSet):\n+    queryset = SegmentsConfig.objects.all()\n+    serializer_class=SegmentsConfigSerializer\n+    pagination_class=SegmentsConfigSetPagination\n+\n+\n+@permission_classes((AllowAny, ))\n+class RulesResultViewSet(viewsets.ViewSet):\n+\n+\t@detail_route(methods=['post'])\n+\tdef list_matched(self, request, segments_config_id):\n+\t\tqueryset = SegmentsConfig.objects.filter(name=segments_config_id)","path":"myapp/segmentsconfigapp/views.py","position":41,"original_position":41,"commit_id":"ad6ec95f54d3585bb8f55c45d7dc4d78e4331b23","original_commit_id":"ad6ec95f54d3585bb8f55c45d7dc4d78e4331b23","user":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"body":"if your endpoint takes the segment name as parameter, then the parameter should be named \"segments_config_name\" and not \"segments_config_id\"","created_at":"2015-08-07T13:36:50Z","updated_at":"2015-08-07T13:36:50Z","html_url":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1#discussion_r36518768","pull_request_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/comments/36518768"},"html":{"href":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1#discussion_r36518768"},"pull_request":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1","id":41888630,"html_url":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1","diff_url":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1.diff","patch_url":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1.patch","issue_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/1","number":1,"state":"open","locked":false,"title":"Original Code Review","user":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-07T12:54:40Z","updated_at":"2015-08-07T13:36:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6ff3d4e03516e15368456900155f1a26f832733","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1/commits","review_comments_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1/comments","review_comment_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/1/comments","statuses_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/statuses/ad6ec95f54d3585bb8f55c45d7dc4d78e4331b23","head":{"label":"pleasedontbelong:review","ref":"review","sha":"ad6ec95f54d3585bb8f55c45d7dc4d78e4331b23","user":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"repo":{"id":40360268,"name":"challenge-alexandre","full_name":"pleasedontbelong/challenge-alexandre","owner":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pleasedontbelong/challenge-alexandre","description":"","fork":false,"url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre","forks_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/forks","keys_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/teams","hooks_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/hooks","issue_events_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/events{/number}","events_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/events","assignees_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/assignees{/user}","branches_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/branches{/branch}","tags_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/tags","blobs_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/refs{/sha}","trees_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/statuses/{sha}","languages_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/languages","stargazers_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/stargazers","contributors_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/contributors","subscribers_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/subscribers","subscription_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/subscription","commits_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/commits{/sha}","git_commits_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/commits{/sha}","comments_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/comments{/number}","issue_comment_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/comments{/number}","contents_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/contents/{+path}","compare_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/merges","archive_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/downloads","issues_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues{/number}","pulls_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls{/number}","milestones_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/milestones{/number}","notifications_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/labels{/name}","releases_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/releases{/id}","created_at":"2015-08-07T12:50:55Z","updated_at":"2015-08-07T12:50:55Z","pushed_at":"2015-08-07T12:54:40Z","git_url":"git://github.com/pleasedontbelong/challenge-alexandre.git","ssh_url":"git@github.com:pleasedontbelong/challenge-alexandre.git","clone_url":"https://github.com/pleasedontbelong/challenge-alexandre.git","svn_url":"https://github.com/pleasedontbelong/challenge-alexandre","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pleasedontbelong:master","ref":"master","sha":"ae78decdd2aeddff06dc077c275e02ac90ccea69","user":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"repo":{"id":40360268,"name":"challenge-alexandre","full_name":"pleasedontbelong/challenge-alexandre","owner":{"login":"pleasedontbelong","id":1785603,"avatar_url":"https://avatars.githubusercontent.com/u/1785603?v=3","gravatar_id":"","url":"https://api.github.com/users/pleasedontbelong","html_url":"https://github.com/pleasedontbelong","followers_url":"https://api.github.com/users/pleasedontbelong/followers","following_url":"https://api.github.com/users/pleasedontbelong/following{/other_user}","gists_url":"https://api.github.com/users/pleasedontbelong/gists{/gist_id}","starred_url":"https://api.github.com/users/pleasedontbelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleasedontbelong/subscriptions","organizations_url":"https://api.github.com/users/pleasedontbelong/orgs","repos_url":"https://api.github.com/users/pleasedontbelong/repos","events_url":"https://api.github.com/users/pleasedontbelong/events{/privacy}","received_events_url":"https://api.github.com/users/pleasedontbelong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pleasedontbelong/challenge-alexandre","description":"","fork":false,"url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre","forks_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/forks","keys_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/teams","hooks_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/hooks","issue_events_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/events{/number}","events_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/events","assignees_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/assignees{/user}","branches_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/branches{/branch}","tags_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/tags","blobs_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/refs{/sha}","trees_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/statuses/{sha}","languages_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/languages","stargazers_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/stargazers","contributors_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/contributors","subscribers_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/subscribers","subscription_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/subscription","commits_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/commits{/sha}","git_commits_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/git/commits{/sha}","comments_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/comments{/number}","issue_comment_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/comments{/number}","contents_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/contents/{+path}","compare_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/merges","archive_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/downloads","issues_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues{/number}","pulls_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls{/number}","milestones_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/milestones{/number}","notifications_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/labels{/name}","releases_url":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/releases{/id}","created_at":"2015-08-07T12:50:55Z","updated_at":"2015-08-07T12:50:55Z","pushed_at":"2015-08-07T12:54:40Z","git_url":"git://github.com/pleasedontbelong/challenge-alexandre.git","ssh_url":"git@github.com:pleasedontbelong/challenge-alexandre.git","clone_url":"https://github.com/pleasedontbelong/challenge-alexandre.git","svn_url":"https://github.com/pleasedontbelong/challenge-alexandre","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1"},"html":{"href":"https://github.com/pleasedontbelong/challenge-alexandre/pull/1"},"issue":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/1"},"comments":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/pleasedontbelong/challenge-alexandre/statuses/ad6ec95f54d3585bb8f55c45d7dc4d78e4331b23"}}}}