{"action":"created","comment":{"url":"https://api.github.com/repos/fidals/refarm-site/pulls/comments/82977333","pull_request_review_id":3846261,"id":82977333,"diff_hunk":"@@ -0,0 +1,110 @@\n+import os\n+\n+from django.db import models\n+from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation\n+from django.contrib.contenttypes.models import ContentType\n+from sorl import thumbnail\n+from sorl.thumbnail import delete\n+\n+\n+def model_directory_path(instance, filename):\n+    def generate_filename(old_name: str, slug: str) -> str:\n+        _, file_extension = os.path.splitext(old_name)\n+        return slug + file_extension\n+\n+    result_filename = generate_filename(filename, instance.slug)\n+    models_folder_name = type(instance.model).__name__.lower()\n+    return '{}/{}/{}'.format(\n+        models_folder_name, instance.model.pk, result_filename)\n+\n+\n+class Image(models.Model):\n+    \"\"\"\n+    Architect thoughts:\n+    One Django cook book recommend us to use Image class.\n+    And to use sorl app for image fields.\n+    Django by Example, chapter 5. http://bit.ly/django-by-example-book\n+    \"\"\"\n+\n+    # http://bit.ly/django-generic-relations","path":"images/models.py","position":29,"original_position":29,"commit_id":"41a5ca661086597c66a2e65bf95249148656e777","original_commit_id":"41a5ca661086597c66a2e65bf95249148656e777","user":{"login":"YozhEzhi","id":2706062,"avatar_url":"https://avatars.githubusercontent.com/u/2706062?v=3","gravatar_id":"","url":"https://api.github.com/users/YozhEzhi","html_url":"https://github.com/YozhEzhi","followers_url":"https://api.github.com/users/YozhEzhi/followers","following_url":"https://api.github.com/users/YozhEzhi/following{/other_user}","gists_url":"https://api.github.com/users/YozhEzhi/gists{/gist_id}","starred_url":"https://api.github.com/users/YozhEzhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YozhEzhi/subscriptions","organizations_url":"https://api.github.com/users/YozhEzhi/orgs","repos_url":"https://api.github.com/users/YozhEzhi/repos","events_url":"https://api.github.com/users/YozhEzhi/events{/privacy}","received_events_url":"https://api.github.com/users/YozhEzhi/received_events","type":"User","site_admin":false},"body":"Ну у меня сразу появилась мысль, что коммент касается следующей строки (30).\r\nНо, по идее, коммент относится к строке 32.\r\nЯ бы в доке описал, что \"тут мы юзаем генерик релейшн\" и ссылка. ","created_at":"2016-10-12T10:26:16Z","updated_at":"2016-10-12T10:26:17Z","html_url":"https://github.com/fidals/refarm-site/pull/24#discussion_r82977333","pull_request_url":"https://api.github.com/repos/fidals/refarm-site/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/comments/82977333"},"html":{"href":"https://github.com/fidals/refarm-site/pull/24#discussion_r82977333"},"pull_request":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/fidals/refarm-site/pulls/24","id":88856734,"html_url":"https://github.com/fidals/refarm-site/pull/24","diff_url":"https://github.com/fidals/refarm-site/pull/24.diff","patch_url":"https://github.com/fidals/refarm-site/pull/24.patch","issue_url":"https://api.github.com/repos/fidals/refarm-site/issues/24","number":24,"state":"open","locked":false,"title":"[811] Images app","user":{"login":"duker33","id":3526796,"avatar_url":"https://avatars.githubusercontent.com/u/3526796?v=3","gravatar_id":"","url":"https://api.github.com/users/duker33","html_url":"https://github.com/duker33","followers_url":"https://api.github.com/users/duker33/followers","following_url":"https://api.github.com/users/duker33/following{/other_user}","gists_url":"https://api.github.com/users/duker33/gists{/gist_id}","starred_url":"https://api.github.com/users/duker33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duker33/subscriptions","organizations_url":"https://api.github.com/users/duker33/orgs","repos_url":"https://api.github.com/users/duker33/repos","events_url":"https://api.github.com/users/duker33/events{/privacy}","received_events_url":"https://api.github.com/users/duker33/received_events","type":"User","site_admin":false},"body":"[ 811 ] Another tests fixes\r\n\r\n[ 811 ] Fix failed code and tests\r\n\r\n[ 811 ] Actualize app tests\r\n\r\n[ 811 ] Update admin functions for images\r\n\r\n[ 811 ] Actualize images tests\r\n\r\n[ 811 ] Rename ImageMixin. Enable product thumbnails for main page for performance\r\n\r\n[ 811 ] Remove unused code. Add several TODOs\r\n\r\n[ 811 ] Add image placeholder functions\r\n\r\n[ 811 ] Add thumbnail generation with one use case\r\n\r\n[ 811 ] Import image models from files in migrations\r\n\r\n[ 811 ] Add untested filling images data\r\n\r\n[ 811 ] Connect page to Image via special connector class\r\n\r\n[ 811 ] Tests for main image set\r\n\r\n[ 811 ] Tests for Image creation\r\n\r\n[ 811 ] Add img tests boilerplate. Actualize images app settings\r\n\r\n[ 811 ] Update Image.save hooks\r\n\r\n[ 811 ] Add images model with base set of fields","created_at":"2016-10-11T15:37:56Z","updated_at":"2016-10-12T10:26:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9737d02fa6dfb59bf5a45602e5433ed163df5ab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fidals/refarm-site/pulls/24/commits","review_comments_url":"https://api.github.com/repos/fidals/refarm-site/pulls/24/comments","review_comment_url":"https://api.github.com/repos/fidals/refarm-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fidals/refarm-site/issues/24/comments","statuses_url":"https://api.github.com/repos/fidals/refarm-site/statuses/41a5ca661086597c66a2e65bf95249148656e777","head":{"label":"fidals:811_images","ref":"811_images","sha":"41a5ca661086597c66a2e65bf95249148656e777","user":{"login":"fidals","id":16228604,"avatar_url":"https://avatars.githubusercontent.com/u/16228604?v=3","gravatar_id":"","url":"https://api.github.com/users/fidals","html_url":"https://github.com/fidals","followers_url":"https://api.github.com/users/fidals/followers","following_url":"https://api.github.com/users/fidals/following{/other_user}","gists_url":"https://api.github.com/users/fidals/gists{/gist_id}","starred_url":"https://api.github.com/users/fidals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidals/subscriptions","organizations_url":"https://api.github.com/users/fidals/orgs","repos_url":"https://api.github.com/users/fidals/repos","events_url":"https://api.github.com/users/fidals/events{/privacy}","received_events_url":"https://api.github.com/users/fidals/received_events","type":"Organization","site_admin":false},"repo":{"id":55603017,"name":"refarm-site","full_name":"fidals/refarm-site","owner":{"login":"fidals","id":16228604,"avatar_url":"https://avatars.githubusercontent.com/u/16228604?v=3","gravatar_id":"","url":"https://api.github.com/users/fidals","html_url":"https://github.com/fidals","followers_url":"https://api.github.com/users/fidals/followers","following_url":"https://api.github.com/users/fidals/following{/other_user}","gists_url":"https://api.github.com/users/fidals/gists{/gist_id}","starred_url":"https://api.github.com/users/fidals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidals/subscriptions","organizations_url":"https://api.github.com/users/fidals/orgs","repos_url":"https://api.github.com/users/fidals/repos","events_url":"https://api.github.com/users/fidals/events{/privacy}","received_events_url":"https://api.github.com/users/fidals/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fidals/refarm-site","description":"Django application with simple blog functions","fork":false,"url":"https://api.github.com/repos/fidals/refarm-site","forks_url":"https://api.github.com/repos/fidals/refarm-site/forks","keys_url":"https://api.github.com/repos/fidals/refarm-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fidals/refarm-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fidals/refarm-site/teams","hooks_url":"https://api.github.com/repos/fidals/refarm-site/hooks","issue_events_url":"https://api.github.com/repos/fidals/refarm-site/issues/events{/number}","events_url":"https://api.github.com/repos/fidals/refarm-site/events","assignees_url":"https://api.github.com/repos/fidals/refarm-site/assignees{/user}","branches_url":"https://api.github.com/repos/fidals/refarm-site/branches{/branch}","tags_url":"https://api.github.com/repos/fidals/refarm-site/tags","blobs_url":"https://api.github.com/repos/fidals/refarm-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fidals/refarm-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fidals/refarm-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/fidals/refarm-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fidals/refarm-site/statuses/{sha}","languages_url":"https://api.github.com/repos/fidals/refarm-site/languages","stargazers_url":"https://api.github.com/repos/fidals/refarm-site/stargazers","contributors_url":"https://api.github.com/repos/fidals/refarm-site/contributors","subscribers_url":"https://api.github.com/repos/fidals/refarm-site/subscribers","subscription_url":"https://api.github.com/repos/fidals/refarm-site/subscription","commits_url":"https://api.github.com/repos/fidals/refarm-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/fidals/refarm-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/fidals/refarm-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/fidals/refarm-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/fidals/refarm-site/contents/{+path}","compare_url":"https://api.github.com/repos/fidals/refarm-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fidals/refarm-site/merges","archive_url":"https://api.github.com/repos/fidals/refarm-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fidals/refarm-site/downloads","issues_url":"https://api.github.com/repos/fidals/refarm-site/issues{/number}","pulls_url":"https://api.github.com/repos/fidals/refarm-site/pulls{/number}","milestones_url":"https://api.github.com/repos/fidals/refarm-site/milestones{/number}","notifications_url":"https://api.github.com/repos/fidals/refarm-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fidals/refarm-site/labels{/name}","releases_url":"https://api.github.com/repos/fidals/refarm-site/releases{/id}","deployments_url":"https://api.github.com/repos/fidals/refarm-site/deployments","created_at":"2016-04-06T12:14:48Z","updated_at":"2016-07-07T09:13:32Z","pushed_at":"2016-10-11T15:37:56Z","git_url":"git://github.com/fidals/refarm-site.git","ssh_url":"git@github.com:fidals/refarm-site.git","clone_url":"https://github.com/fidals/refarm-site.git","svn_url":"https://github.com/fidals/refarm-site","homepage":"","size":148,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"fidals:master","ref":"master","sha":"0abcfb71493f1eeb58115bf346425c0c9d718c2a","user":{"login":"fidals","id":16228604,"avatar_url":"https://avatars.githubusercontent.com/u/16228604?v=3","gravatar_id":"","url":"https://api.github.com/users/fidals","html_url":"https://github.com/fidals","followers_url":"https://api.github.com/users/fidals/followers","following_url":"https://api.github.com/users/fidals/following{/other_user}","gists_url":"https://api.github.com/users/fidals/gists{/gist_id}","starred_url":"https://api.github.com/users/fidals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidals/subscriptions","organizations_url":"https://api.github.com/users/fidals/orgs","repos_url":"https://api.github.com/users/fidals/repos","events_url":"https://api.github.com/users/fidals/events{/privacy}","received_events_url":"https://api.github.com/users/fidals/received_events","type":"Organization","site_admin":false},"repo":{"id":55603017,"name":"refarm-site","full_name":"fidals/refarm-site","owner":{"login":"fidals","id":16228604,"avatar_url":"https://avatars.githubusercontent.com/u/16228604?v=3","gravatar_id":"","url":"https://api.github.com/users/fidals","html_url":"https://github.com/fidals","followers_url":"https://api.github.com/users/fidals/followers","following_url":"https://api.github.com/users/fidals/following{/other_user}","gists_url":"https://api.github.com/users/fidals/gists{/gist_id}","starred_url":"https://api.github.com/users/fidals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidals/subscriptions","organizations_url":"https://api.github.com/users/fidals/orgs","repos_url":"https://api.github.com/users/fidals/repos","events_url":"https://api.github.com/users/fidals/events{/privacy}","received_events_url":"https://api.github.com/users/fidals/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fidals/refarm-site","description":"Django application with simple blog functions","fork":false,"url":"https://api.github.com/repos/fidals/refarm-site","forks_url":"https://api.github.com/repos/fidals/refarm-site/forks","keys_url":"https://api.github.com/repos/fidals/refarm-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fidals/refarm-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fidals/refarm-site/teams","hooks_url":"https://api.github.com/repos/fidals/refarm-site/hooks","issue_events_url":"https://api.github.com/repos/fidals/refarm-site/issues/events{/number}","events_url":"https://api.github.com/repos/fidals/refarm-site/events","assignees_url":"https://api.github.com/repos/fidals/refarm-site/assignees{/user}","branches_url":"https://api.github.com/repos/fidals/refarm-site/branches{/branch}","tags_url":"https://api.github.com/repos/fidals/refarm-site/tags","blobs_url":"https://api.github.com/repos/fidals/refarm-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fidals/refarm-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fidals/refarm-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/fidals/refarm-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fidals/refarm-site/statuses/{sha}","languages_url":"https://api.github.com/repos/fidals/refarm-site/languages","stargazers_url":"https://api.github.com/repos/fidals/refarm-site/stargazers","contributors_url":"https://api.github.com/repos/fidals/refarm-site/contributors","subscribers_url":"https://api.github.com/repos/fidals/refarm-site/subscribers","subscription_url":"https://api.github.com/repos/fidals/refarm-site/subscription","commits_url":"https://api.github.com/repos/fidals/refarm-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/fidals/refarm-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/fidals/refarm-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/fidals/refarm-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/fidals/refarm-site/contents/{+path}","compare_url":"https://api.github.com/repos/fidals/refarm-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fidals/refarm-site/merges","archive_url":"https://api.github.com/repos/fidals/refarm-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fidals/refarm-site/downloads","issues_url":"https://api.github.com/repos/fidals/refarm-site/issues{/number}","pulls_url":"https://api.github.com/repos/fidals/refarm-site/pulls{/number}","milestones_url":"https://api.github.com/repos/fidals/refarm-site/milestones{/number}","notifications_url":"https://api.github.com/repos/fidals/refarm-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fidals/refarm-site/labels{/name}","releases_url":"https://api.github.com/repos/fidals/refarm-site/releases{/id}","deployments_url":"https://api.github.com/repos/fidals/refarm-site/deployments","created_at":"2016-04-06T12:14:48Z","updated_at":"2016-07-07T09:13:32Z","pushed_at":"2016-10-11T15:37:56Z","git_url":"git://github.com/fidals/refarm-site.git","ssh_url":"git@github.com:fidals/refarm-site.git","clone_url":"https://github.com/fidals/refarm-site.git","svn_url":"https://github.com/fidals/refarm-site","homepage":"","size":148,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/24"},"html":{"href":"https://github.com/fidals/refarm-site/pull/24"},"issue":{"href":"https://api.github.com/repos/fidals/refarm-site/issues/24"},"comments":{"href":"https://api.github.com/repos/fidals/refarm-site/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fidals/refarm-site/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/fidals/refarm-site/statuses/41a5ca661086597c66a2e65bf95249148656e777"}}}}
{"actor":{"display_login":"YozhEzhi"}}