{"action":"created","comment":{"url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/comments/126623188","pull_request_review_id":49122212,"id":126623188,"diff_hunk":"@@ -0,0 +1,55 @@\n+\"\"\"Module contain photo model class and methods.\"\"\"\n+\n+from django.core.exceptions import ObjectDoesNotExist\n+from django.db import models\n+\n+\n+class Photo(models.Model):\n+    \"\"\"\n+     Photo\n+     :argument id: int - auto generated primary key\n+     :argument src: url - photo source link\n+     :argument user_id: int - ToDo foreign key to User model id\n+     :argument trip_id: int - Todo foreign key to Trip model id\n+     :argument checkpoint_id: int - ToDo foreign to Checkpoint model id\n+     :argument description: str - description to photo\n+    .\"\"\"\n+    src = models.URLField(max_length=200)\n+    user_id = models.IntegerField()\n+    trip_id = models.IntegerField(null=True)\n+    checkpoint_id = models.IntegerField(null=True)\n+    description = models.TextField(null=True)\n+\n+    @staticmethod\n+    def get_by_id(photo_id):\n+        \"\"\"Method return one element by id or None if exception.\"\"\"\n+        try:\n+            return Photo.objects.get(id=photo_id)\n+        except ObjectDoesNotExist:\n+            return None\n+\n+    def create(self, src, user_id, trip_id=None, checkpoint_id=None, description=None):","path":"myTrip/photo/models.py","position":31,"original_position":31,"commit_id":"5ba04344ca3dc127c6041006b131b356b5ce5f0d","original_commit_id":"5ba04344ca3dc127c6041006b131b356b5ce5f0d","user":{"login":"lhalam","id":3837059,"avatar_url":"https://avatars3.githubusercontent.com/u/3837059?v=3","gravatar_id":"","url":"https://api.github.com/users/lhalam","html_url":"https://github.com/lhalam","followers_url":"https://api.github.com/users/lhalam/followers","following_url":"https://api.github.com/users/lhalam/following{/other_user}","gists_url":"https://api.github.com/users/lhalam/gists{/gist_id}","starred_url":"https://api.github.com/users/lhalam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhalam/subscriptions","organizations_url":"https://api.github.com/users/lhalam/orgs","repos_url":"https://api.github.com/users/lhalam/repos","events_url":"https://api.github.com/users/lhalam/events{/privacy}","received_events_url":"https://api.github.com/users/lhalam/received_events","type":"User","site_admin":false},"body":"use static method","created_at":"2017-07-11T08:16:02Z","updated_at":"2017-07-11T08:17:16Z","html_url":"https://github.com/Lv-246Python/myTrip/pull/10#discussion_r126623188","pull_request_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/comments/126623188"},"html":{"href":"https://github.com/Lv-246Python/myTrip/pull/10#discussion_r126623188"},"pull_request":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10","id":129534891,"html_url":"https://github.com/Lv-246Python/myTrip/pull/10","diff_url":"https://github.com/Lv-246Python/myTrip/pull/10.diff","patch_url":"https://github.com/Lv-246Python/myTrip/pull/10.patch","issue_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/10","number":10,"state":"open","locked":false,"title":"28 create photo app","user":{"login":"Ashiato","id":29370290,"avatar_url":"https://avatars2.githubusercontent.com/u/29370290?v=3","gravatar_id":"","url":"https://api.github.com/users/Ashiato","html_url":"https://github.com/Ashiato","followers_url":"https://api.github.com/users/Ashiato/followers","following_url":"https://api.github.com/users/Ashiato/following{/other_user}","gists_url":"https://api.github.com/users/Ashiato/gists{/gist_id}","starred_url":"https://api.github.com/users/Ashiato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ashiato/subscriptions","organizations_url":"https://api.github.com/users/Ashiato/orgs","repos_url":"https://api.github.com/users/Ashiato/repos","events_url":"https://api.github.com/users/Ashiato/events{/privacy}","received_events_url":"https://api.github.com/users/Ashiato/received_events","type":"User","site_admin":false},"body":"## TRELLO\r\n\r\n* [Main Trello ticket](https://trello.com/c/bC4g4S1z/28-create-photo-app)\r\n\r\n\r\n## Code reviewers\r\n\r\n\r\n- [x] @KarnaushenkoVO\r\n- [x] @PanLeon\r\n- [x] @yuriiZherebukh\r\n\r\n### Second Level Review\r\n\r\n- [ ] @byshovets\r\n- [ ] @lhalam\r\n\r\n\r\n## CHECK LIST\r\n- [ ]  СI passed\r\n- [ ]  Сode coverage >=90%\r\n- [ ]  PR is reviewed manually again (to make sure you have 100% ready code)\r\n- [ ]  All reviewers agreed to merge the PR\r\n- [ ]  I've checked new feature as logged in and logged out user if needed\r\n- [ ]  PR meets all conventions\r\n","created_at":"2017-07-08T16:51:11Z","updated_at":"2017-07-11T08:17:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca7932354cae79df95db075b8ac62a63fd6ae3c6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10/commits","review_comments_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10/comments","review_comment_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/10/comments","statuses_url":"https://api.github.com/repos/Lv-246Python/myTrip/statuses/5ba04344ca3dc127c6041006b131b356b5ce5f0d","head":{"label":"Lv-246Python:28-create-photo-app","ref":"28-create-photo-app","sha":"5ba04344ca3dc127c6041006b131b356b5ce5f0d","user":{"login":"Lv-246Python","id":29449495,"avatar_url":"https://avatars3.githubusercontent.com/u/29449495?v=3","gravatar_id":"","url":"https://api.github.com/users/Lv-246Python","html_url":"https://github.com/Lv-246Python","followers_url":"https://api.github.com/users/Lv-246Python/followers","following_url":"https://api.github.com/users/Lv-246Python/following{/other_user}","gists_url":"https://api.github.com/users/Lv-246Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Lv-246Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lv-246Python/subscriptions","organizations_url":"https://api.github.com/users/Lv-246Python/orgs","repos_url":"https://api.github.com/users/Lv-246Python/repos","events_url":"https://api.github.com/users/Lv-246Python/events{/privacy}","received_events_url":"https://api.github.com/users/Lv-246Python/received_events","type":"Organization","site_admin":false},"repo":{"id":96298378,"name":"myTrip","full_name":"Lv-246Python/myTrip","owner":{"login":"Lv-246Python","id":29449495,"avatar_url":"https://avatars3.githubusercontent.com/u/29449495?v=3","gravatar_id":"","url":"https://api.github.com/users/Lv-246Python","html_url":"https://github.com/Lv-246Python","followers_url":"https://api.github.com/users/Lv-246Python/followers","following_url":"https://api.github.com/users/Lv-246Python/following{/other_user}","gists_url":"https://api.github.com/users/Lv-246Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Lv-246Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lv-246Python/subscriptions","organizations_url":"https://api.github.com/users/Lv-246Python/orgs","repos_url":"https://api.github.com/users/Lv-246Python/repos","events_url":"https://api.github.com/users/Lv-246Python/events{/privacy}","received_events_url":"https://api.github.com/users/Lv-246Python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Lv-246Python/myTrip","description":null,"fork":false,"url":"https://api.github.com/repos/Lv-246Python/myTrip","forks_url":"https://api.github.com/repos/Lv-246Python/myTrip/forks","keys_url":"https://api.github.com/repos/Lv-246Python/myTrip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lv-246Python/myTrip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lv-246Python/myTrip/teams","hooks_url":"https://api.github.com/repos/Lv-246Python/myTrip/hooks","issue_events_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/events{/number}","events_url":"https://api.github.com/repos/Lv-246Python/myTrip/events","assignees_url":"https://api.github.com/repos/Lv-246Python/myTrip/assignees{/user}","branches_url":"https://api.github.com/repos/Lv-246Python/myTrip/branches{/branch}","tags_url":"https://api.github.com/repos/Lv-246Python/myTrip/tags","blobs_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lv-246Python/myTrip/statuses/{sha}","languages_url":"https://api.github.com/repos/Lv-246Python/myTrip/languages","stargazers_url":"https://api.github.com/repos/Lv-246Python/myTrip/stargazers","contributors_url":"https://api.github.com/repos/Lv-246Python/myTrip/contributors","subscribers_url":"https://api.github.com/repos/Lv-246Python/myTrip/subscribers","subscription_url":"https://api.github.com/repos/Lv-246Python/myTrip/subscription","commits_url":"https://api.github.com/repos/Lv-246Python/myTrip/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lv-246Python/myTrip/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lv-246Python/myTrip/contents/{+path}","compare_url":"https://api.github.com/repos/Lv-246Python/myTrip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lv-246Python/myTrip/merges","archive_url":"https://api.github.com/repos/Lv-246Python/myTrip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lv-246Python/myTrip/downloads","issues_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues{/number}","pulls_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls{/number}","milestones_url":"https://api.github.com/repos/Lv-246Python/myTrip/milestones{/number}","notifications_url":"https://api.github.com/repos/Lv-246Python/myTrip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lv-246Python/myTrip/labels{/name}","releases_url":"https://api.github.com/repos/Lv-246Python/myTrip/releases{/id}","deployments_url":"https://api.github.com/repos/Lv-246Python/myTrip/deployments","created_at":"2017-07-05T08:50:56Z","updated_at":"2017-07-06T08:48:15Z","pushed_at":"2017-07-11T07:55:12Z","git_url":"git://github.com/Lv-246Python/myTrip.git","ssh_url":"git@github.com:Lv-246Python/myTrip.git","clone_url":"https://github.com/Lv-246Python/myTrip.git","svn_url":"https://github.com/Lv-246Python/myTrip","homepage":null,"size":84,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":0,"default_branch":"dev"}},"base":{"label":"Lv-246Python:dev","ref":"dev","sha":"0d8c6cc4463777b9151a440398b8f368e7c8a601","user":{"login":"Lv-246Python","id":29449495,"avatar_url":"https://avatars3.githubusercontent.com/u/29449495?v=3","gravatar_id":"","url":"https://api.github.com/users/Lv-246Python","html_url":"https://github.com/Lv-246Python","followers_url":"https://api.github.com/users/Lv-246Python/followers","following_url":"https://api.github.com/users/Lv-246Python/following{/other_user}","gists_url":"https://api.github.com/users/Lv-246Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Lv-246Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lv-246Python/subscriptions","organizations_url":"https://api.github.com/users/Lv-246Python/orgs","repos_url":"https://api.github.com/users/Lv-246Python/repos","events_url":"https://api.github.com/users/Lv-246Python/events{/privacy}","received_events_url":"https://api.github.com/users/Lv-246Python/received_events","type":"Organization","site_admin":false},"repo":{"id":96298378,"name":"myTrip","full_name":"Lv-246Python/myTrip","owner":{"login":"Lv-246Python","id":29449495,"avatar_url":"https://avatars3.githubusercontent.com/u/29449495?v=3","gravatar_id":"","url":"https://api.github.com/users/Lv-246Python","html_url":"https://github.com/Lv-246Python","followers_url":"https://api.github.com/users/Lv-246Python/followers","following_url":"https://api.github.com/users/Lv-246Python/following{/other_user}","gists_url":"https://api.github.com/users/Lv-246Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Lv-246Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lv-246Python/subscriptions","organizations_url":"https://api.github.com/users/Lv-246Python/orgs","repos_url":"https://api.github.com/users/Lv-246Python/repos","events_url":"https://api.github.com/users/Lv-246Python/events{/privacy}","received_events_url":"https://api.github.com/users/Lv-246Python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Lv-246Python/myTrip","description":null,"fork":false,"url":"https://api.github.com/repos/Lv-246Python/myTrip","forks_url":"https://api.github.com/repos/Lv-246Python/myTrip/forks","keys_url":"https://api.github.com/repos/Lv-246Python/myTrip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lv-246Python/myTrip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lv-246Python/myTrip/teams","hooks_url":"https://api.github.com/repos/Lv-246Python/myTrip/hooks","issue_events_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/events{/number}","events_url":"https://api.github.com/repos/Lv-246Python/myTrip/events","assignees_url":"https://api.github.com/repos/Lv-246Python/myTrip/assignees{/user}","branches_url":"https://api.github.com/repos/Lv-246Python/myTrip/branches{/branch}","tags_url":"https://api.github.com/repos/Lv-246Python/myTrip/tags","blobs_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lv-246Python/myTrip/statuses/{sha}","languages_url":"https://api.github.com/repos/Lv-246Python/myTrip/languages","stargazers_url":"https://api.github.com/repos/Lv-246Python/myTrip/stargazers","contributors_url":"https://api.github.com/repos/Lv-246Python/myTrip/contributors","subscribers_url":"https://api.github.com/repos/Lv-246Python/myTrip/subscribers","subscription_url":"https://api.github.com/repos/Lv-246Python/myTrip/subscription","commits_url":"https://api.github.com/repos/Lv-246Python/myTrip/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lv-246Python/myTrip/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lv-246Python/myTrip/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lv-246Python/myTrip/contents/{+path}","compare_url":"https://api.github.com/repos/Lv-246Python/myTrip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lv-246Python/myTrip/merges","archive_url":"https://api.github.com/repos/Lv-246Python/myTrip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lv-246Python/myTrip/downloads","issues_url":"https://api.github.com/repos/Lv-246Python/myTrip/issues{/number}","pulls_url":"https://api.github.com/repos/Lv-246Python/myTrip/pulls{/number}","milestones_url":"https://api.github.com/repos/Lv-246Python/myTrip/milestones{/number}","notifications_url":"https://api.github.com/repos/Lv-246Python/myTrip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lv-246Python/myTrip/labels{/name}","releases_url":"https://api.github.com/repos/Lv-246Python/myTrip/releases{/id}","deployments_url":"https://api.github.com/repos/Lv-246Python/myTrip/deployments","created_at":"2017-07-05T08:50:56Z","updated_at":"2017-07-06T08:48:15Z","pushed_at":"2017-07-11T07:55:12Z","git_url":"git://github.com/Lv-246Python/myTrip.git","ssh_url":"git@github.com:Lv-246Python/myTrip.git","clone_url":"https://github.com/Lv-246Python/myTrip.git","svn_url":"https://github.com/Lv-246Python/myTrip","homepage":null,"size":84,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10"},"html":{"href":"https://github.com/Lv-246Python/myTrip/pull/10"},"issue":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/issues/10"},"comments":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/Lv-246Python/myTrip/statuses/5ba04344ca3dc127c6041006b131b356b5ce5f0d"}}}}
{"actor":{"display_login":"lhalam"}}