{"action":"created","comment":{"url":"https://api.github.com/repos/svalee/shop/pulls/comments/149975797","pull_request_review_id":75454505,"id":149975797,"diff_hunk":"@@ -1,41 +1,45 @@\n-from django.shortcuts import render\n from django.views.generic.list import ListView\n-from .models import Category, Product\n from django.views.generic.detail import DetailView\n-from django.shortcuts import get_object_or_404\n-from django.db.models import Q\n+\n+from .models import Category, Product\n \n \n class CategoryListView(ListView):\n     model = Category\n-    # template_name = 'category_list.html'\n+    template_name = 'showcase/category_list.html'\n \n-    def get_context_data(self, **kwargs):\n+    def get_queryset(self):\n         query = self.request.GET.get('q')\n-        result = []\n-        context = {}\n         if query:\n-            context['object_list'] = Category.objects.filter(name__icontains=query)\n+            return Category.objects.filter(name__icontains=query)\n         else:\n-            context = super(CategoryListView, self).get_context_data(**kwargs)\n+            return super(CategoryListView, self).get_queryset()\n+\n+    def get_context_data(self, **kwargs):\n+        context = super(CategoryListView, self).get_context_data(**kwargs)\n         return context\n \n \n-class CategoryDetailView(DetailView):\n+class ProductsInCategoryDetailView(DetailView):\n     model = Category\n+    template_name = 'showcase/category_detail.html'\n \n-    def get_context_data(self, **kwargs):\n-        context = {}\n+    def get_queryset(self):\n         query = self.request.GET.get('q')\n         if query:\n-            context['objects'] = Product.objects.filter(name__icontains=query)\n+            return Product.objects.filter(name__icontains=query)","path":"showcase/views.py","position":44,"original_position":44,"commit_id":"d77803427ea0459739610c7d1c37d173f03fb7a8","original_commit_id":"d77803427ea0459739610c7d1c37d173f03fb7a8","user":{"login":"haos616","id":693856,"avatar_url":"https://avatars0.githubusercontent.com/u/693856?v=4","gravatar_id":"","url":"https://api.github.com/users/haos616","html_url":"https://github.com/haos616","followers_url":"https://api.github.com/users/haos616/followers","following_url":"https://api.github.com/users/haos616/following{/other_user}","gists_url":"https://api.github.com/users/haos616/gists{/gist_id}","starred_url":"https://api.github.com/users/haos616/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haos616/subscriptions","organizations_url":"https://api.github.com/users/haos616/orgs","repos_url":"https://api.github.com/users/haos616/repos","events_url":"https://api.github.com/users/haos616/events{/privacy}","received_events_url":"https://api.github.com/users/haos616/received_events","type":"User","site_admin":false},"body":"И очень странно. Ты изначально указывешь модель `Category` а потом в `objects` добавляешь Products. Может стоит по другому назвать?","created_at":"2017-11-09T14:28:45Z","updated_at":"2017-11-09T14:28:45Z","html_url":"https://github.com/svalee/shop/pull/1#discussion_r149975797","pull_request_url":"https://api.github.com/repos/svalee/shop/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/svalee/shop/pulls/comments/149975797"},"html":{"href":"https://github.com/svalee/shop/pull/1#discussion_r149975797"},"pull_request":{"href":"https://api.github.com/repos/svalee/shop/pulls/1"}},"in_reply_to_id":149974078},"pull_request":{"url":"https://api.github.com/repos/svalee/shop/pulls/1","id":151336729,"html_url":"https://github.com/svalee/shop/pull/1","diff_url":"https://github.com/svalee/shop/pull/1.diff","patch_url":"https://github.com/svalee/shop/pull/1.patch","issue_url":"https://api.github.com/repos/svalee/shop/issues/1","number":1,"state":"open","locked":false,"title":"Images is now uploading to media directory","user":{"login":"svalee","id":25705931,"avatar_url":"https://avatars1.githubusercontent.com/u/25705931?v=4","gravatar_id":"","url":"https://api.github.com/users/svalee","html_url":"https://github.com/svalee","followers_url":"https://api.github.com/users/svalee/followers","following_url":"https://api.github.com/users/svalee/following{/other_user}","gists_url":"https://api.github.com/users/svalee/gists{/gist_id}","starred_url":"https://api.github.com/users/svalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalee/subscriptions","organizations_url":"https://api.github.com/users/svalee/orgs","repos_url":"https://api.github.com/users/svalee/repos","events_url":"https://api.github.com/users/svalee/events{/privacy}","received_events_url":"https://api.github.com/users/svalee/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-08T09:54:01Z","updated_at":"2017-11-09T14:28:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e92f3ab2b61c43d0c423910ee635d2da9338ef0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/svalee/shop/pulls/1/commits","review_comments_url":"https://api.github.com/repos/svalee/shop/pulls/1/comments","review_comment_url":"https://api.github.com/repos/svalee/shop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/svalee/shop/issues/1/comments","statuses_url":"https://api.github.com/repos/svalee/shop/statuses/d77803427ea0459739610c7d1c37d173f03fb7a8","head":{"label":"svalee:dev","ref":"dev","sha":"d77803427ea0459739610c7d1c37d173f03fb7a8","user":{"login":"svalee","id":25705931,"avatar_url":"https://avatars1.githubusercontent.com/u/25705931?v=4","gravatar_id":"","url":"https://api.github.com/users/svalee","html_url":"https://github.com/svalee","followers_url":"https://api.github.com/users/svalee/followers","following_url":"https://api.github.com/users/svalee/following{/other_user}","gists_url":"https://api.github.com/users/svalee/gists{/gist_id}","starred_url":"https://api.github.com/users/svalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalee/subscriptions","organizations_url":"https://api.github.com/users/svalee/orgs","repos_url":"https://api.github.com/users/svalee/repos","events_url":"https://api.github.com/users/svalee/events{/privacy}","received_events_url":"https://api.github.com/users/svalee/received_events","type":"User","site_admin":false},"repo":{"id":109868500,"name":"shop","full_name":"svalee/shop","owner":{"login":"svalee","id":25705931,"avatar_url":"https://avatars1.githubusercontent.com/u/25705931?v=4","gravatar_id":"","url":"https://api.github.com/users/svalee","html_url":"https://github.com/svalee","followers_url":"https://api.github.com/users/svalee/followers","following_url":"https://api.github.com/users/svalee/following{/other_user}","gists_url":"https://api.github.com/users/svalee/gists{/gist_id}","starred_url":"https://api.github.com/users/svalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalee/subscriptions","organizations_url":"https://api.github.com/users/svalee/orgs","repos_url":"https://api.github.com/users/svalee/repos","events_url":"https://api.github.com/users/svalee/events{/privacy}","received_events_url":"https://api.github.com/users/svalee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svalee/shop","description":null,"fork":false,"url":"https://api.github.com/repos/svalee/shop","forks_url":"https://api.github.com/repos/svalee/shop/forks","keys_url":"https://api.github.com/repos/svalee/shop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svalee/shop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svalee/shop/teams","hooks_url":"https://api.github.com/repos/svalee/shop/hooks","issue_events_url":"https://api.github.com/repos/svalee/shop/issues/events{/number}","events_url":"https://api.github.com/repos/svalee/shop/events","assignees_url":"https://api.github.com/repos/svalee/shop/assignees{/user}","branches_url":"https://api.github.com/repos/svalee/shop/branches{/branch}","tags_url":"https://api.github.com/repos/svalee/shop/tags","blobs_url":"https://api.github.com/repos/svalee/shop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svalee/shop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svalee/shop/git/refs{/sha}","trees_url":"https://api.github.com/repos/svalee/shop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svalee/shop/statuses/{sha}","languages_url":"https://api.github.com/repos/svalee/shop/languages","stargazers_url":"https://api.github.com/repos/svalee/shop/stargazers","contributors_url":"https://api.github.com/repos/svalee/shop/contributors","subscribers_url":"https://api.github.com/repos/svalee/shop/subscribers","subscription_url":"https://api.github.com/repos/svalee/shop/subscription","commits_url":"https://api.github.com/repos/svalee/shop/commits{/sha}","git_commits_url":"https://api.github.com/repos/svalee/shop/git/commits{/sha}","comments_url":"https://api.github.com/repos/svalee/shop/comments{/number}","issue_comment_url":"https://api.github.com/repos/svalee/shop/issues/comments{/number}","contents_url":"https://api.github.com/repos/svalee/shop/contents/{+path}","compare_url":"https://api.github.com/repos/svalee/shop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svalee/shop/merges","archive_url":"https://api.github.com/repos/svalee/shop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svalee/shop/downloads","issues_url":"https://api.github.com/repos/svalee/shop/issues{/number}","pulls_url":"https://api.github.com/repos/svalee/shop/pulls{/number}","milestones_url":"https://api.github.com/repos/svalee/shop/milestones{/number}","notifications_url":"https://api.github.com/repos/svalee/shop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svalee/shop/labels{/name}","releases_url":"https://api.github.com/repos/svalee/shop/releases{/id}","deployments_url":"https://api.github.com/repos/svalee/shop/deployments","created_at":"2017-11-07T17:28:14Z","updated_at":"2017-11-08T23:42:55Z","pushed_at":"2017-11-09T14:12:24Z","git_url":"git://github.com/svalee/shop.git","ssh_url":"git@github.com:svalee/shop.git","clone_url":"https://github.com/svalee/shop.git","svn_url":"https://github.com/svalee/shop","homepage":null,"size":11,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"svalee:master","ref":"master","sha":"8de92acbee36c238545b7173d162ee4f9e18afd7","user":{"login":"svalee","id":25705931,"avatar_url":"https://avatars1.githubusercontent.com/u/25705931?v=4","gravatar_id":"","url":"https://api.github.com/users/svalee","html_url":"https://github.com/svalee","followers_url":"https://api.github.com/users/svalee/followers","following_url":"https://api.github.com/users/svalee/following{/other_user}","gists_url":"https://api.github.com/users/svalee/gists{/gist_id}","starred_url":"https://api.github.com/users/svalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalee/subscriptions","organizations_url":"https://api.github.com/users/svalee/orgs","repos_url":"https://api.github.com/users/svalee/repos","events_url":"https://api.github.com/users/svalee/events{/privacy}","received_events_url":"https://api.github.com/users/svalee/received_events","type":"User","site_admin":false},"repo":{"id":109868500,"name":"shop","full_name":"svalee/shop","owner":{"login":"svalee","id":25705931,"avatar_url":"https://avatars1.githubusercontent.com/u/25705931?v=4","gravatar_id":"","url":"https://api.github.com/users/svalee","html_url":"https://github.com/svalee","followers_url":"https://api.github.com/users/svalee/followers","following_url":"https://api.github.com/users/svalee/following{/other_user}","gists_url":"https://api.github.com/users/svalee/gists{/gist_id}","starred_url":"https://api.github.com/users/svalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalee/subscriptions","organizations_url":"https://api.github.com/users/svalee/orgs","repos_url":"https://api.github.com/users/svalee/repos","events_url":"https://api.github.com/users/svalee/events{/privacy}","received_events_url":"https://api.github.com/users/svalee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svalee/shop","description":null,"fork":false,"url":"https://api.github.com/repos/svalee/shop","forks_url":"https://api.github.com/repos/svalee/shop/forks","keys_url":"https://api.github.com/repos/svalee/shop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svalee/shop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svalee/shop/teams","hooks_url":"https://api.github.com/repos/svalee/shop/hooks","issue_events_url":"https://api.github.com/repos/svalee/shop/issues/events{/number}","events_url":"https://api.github.com/repos/svalee/shop/events","assignees_url":"https://api.github.com/repos/svalee/shop/assignees{/user}","branches_url":"https://api.github.com/repos/svalee/shop/branches{/branch}","tags_url":"https://api.github.com/repos/svalee/shop/tags","blobs_url":"https://api.github.com/repos/svalee/shop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svalee/shop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svalee/shop/git/refs{/sha}","trees_url":"https://api.github.com/repos/svalee/shop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svalee/shop/statuses/{sha}","languages_url":"https://api.github.com/repos/svalee/shop/languages","stargazers_url":"https://api.github.com/repos/svalee/shop/stargazers","contributors_url":"https://api.github.com/repos/svalee/shop/contributors","subscribers_url":"https://api.github.com/repos/svalee/shop/subscribers","subscription_url":"https://api.github.com/repos/svalee/shop/subscription","commits_url":"https://api.github.com/repos/svalee/shop/commits{/sha}","git_commits_url":"https://api.github.com/repos/svalee/shop/git/commits{/sha}","comments_url":"https://api.github.com/repos/svalee/shop/comments{/number}","issue_comment_url":"https://api.github.com/repos/svalee/shop/issues/comments{/number}","contents_url":"https://api.github.com/repos/svalee/shop/contents/{+path}","compare_url":"https://api.github.com/repos/svalee/shop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svalee/shop/merges","archive_url":"https://api.github.com/repos/svalee/shop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svalee/shop/downloads","issues_url":"https://api.github.com/repos/svalee/shop/issues{/number}","pulls_url":"https://api.github.com/repos/svalee/shop/pulls{/number}","milestones_url":"https://api.github.com/repos/svalee/shop/milestones{/number}","notifications_url":"https://api.github.com/repos/svalee/shop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svalee/shop/labels{/name}","releases_url":"https://api.github.com/repos/svalee/shop/releases{/id}","deployments_url":"https://api.github.com/repos/svalee/shop/deployments","created_at":"2017-11-07T17:28:14Z","updated_at":"2017-11-08T23:42:55Z","pushed_at":"2017-11-09T14:12:24Z","git_url":"git://github.com/svalee/shop.git","ssh_url":"git@github.com:svalee/shop.git","clone_url":"https://github.com/svalee/shop.git","svn_url":"https://github.com/svalee/shop","homepage":null,"size":11,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/svalee/shop/pulls/1"},"html":{"href":"https://github.com/svalee/shop/pull/1"},"issue":{"href":"https://api.github.com/repos/svalee/shop/issues/1"},"comments":{"href":"https://api.github.com/repos/svalee/shop/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/svalee/shop/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/svalee/shop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/svalee/shop/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/svalee/shop/statuses/d77803427ea0459739610c7d1c37d173f03fb7a8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"haos616"}}