{"action":"created","comment":{"url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/comments/168307318","pull_request_review_id":96653906,"id":168307318,"diff_hunk":"@@ -0,0 +1,36 @@\n+\"\"\"Models for the classic application.\"\"\"\n+\n+from django.db import models\n+\n+\n+class ClassicPage(models.Model):\n+    \"\"\"Model for Classic CS Unplugged page in database.\"\"\"\n+\n+    #  Auto-incrementing 'id' field is automatically set by Django\n+    slug = models.SlugField(unique=True)\n+    name = models.CharField(max_length=200)\n+    redirect = models.URLField()\n+\n+    def get_absolute_url(self):\n+        \"\"\"Return the canonical URL for a ClassicPage.\n+\n+        Returns:\n+            URL as string.\n+        \"\"\"\n+        return self.redirect\n+\n+    def model_type(self):","path":"csunplugged/classic/models.py","position":22,"original_position":22,"commit_id":"355b73115abbf284025c063829a17c13047851bd","original_commit_id":"355b73115abbf284025c063829a17c13047851bd","user":{"login":"hayleyavw","id":6937219,"avatar_url":"https://avatars3.githubusercontent.com/u/6937219?v=4","gravatar_id":"","url":"https://api.github.com/users/hayleyavw","html_url":"https://github.com/hayleyavw","followers_url":"https://api.github.com/users/hayleyavw/followers","following_url":"https://api.github.com/users/hayleyavw/following{/other_user}","gists_url":"https://api.github.com/users/hayleyavw/gists{/gist_id}","starred_url":"https://api.github.com/users/hayleyavw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayleyavw/subscriptions","organizations_url":"https://api.github.com/users/hayleyavw/orgs","repos_url":"https://api.github.com/users/hayleyavw/repos","events_url":"https://api.github.com/users/hayleyavw/events{/privacy}","received_events_url":"https://api.github.com/users/hayleyavw/received_events","type":"User","site_admin":false},"body":"OH that's why it's there :+1: ","created_at":"2018-02-14T20:57:07Z","updated_at":"2018-02-14T20:57:07Z","html_url":"https://github.com/uccser/cs-unplugged/pull/886#discussion_r168307318","pull_request_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/comments/168307318"},"html":{"href":"https://github.com/uccser/cs-unplugged/pull/886#discussion_r168307318"},"pull_request":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886"}},"in_reply_to_id":168300209},"pull_request":{"url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886","id":169003500,"html_url":"https://github.com/uccser/cs-unplugged/pull/886","diff_url":"https://github.com/uccser/cs-unplugged/pull/886.diff","patch_url":"https://github.com/uccser/cs-unplugged/pull/886.patch","issue_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/886","number":886,"state":"open","locked":false,"title":"Enable searching of general and Classic CS Unplugged pages","user":{"login":"JackMorganNZ","id":8001048,"avatar_url":"https://avatars3.githubusercontent.com/u/8001048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackMorganNZ","html_url":"https://github.com/JackMorganNZ","followers_url":"https://api.github.com/users/JackMorganNZ/followers","following_url":"https://api.github.com/users/JackMorganNZ/following{/other_user}","gists_url":"https://api.github.com/users/JackMorganNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/JackMorganNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackMorganNZ/subscriptions","organizations_url":"https://api.github.com/users/JackMorganNZ/orgs","repos_url":"https://api.github.com/users/JackMorganNZ/repos","events_url":"https://api.github.com/users/JackMorganNZ/events{/privacy}","received_events_url":"https://api.github.com/users/JackMorganNZ/received_events","type":"User","site_admin":false},"body":"This pull request allows the user to search for both general pages and Classic CS Unplugged pages.\r\n\r\nThe documentation will be the weakest part of this pull request due to the unnatural (but best) solution so keen for feedback on it.\r\n\r\n## Reasonings\r\n\r\n### Duplicate data in model configuration files and view/url files\r\n\r\nSee documentation in [docs/source/developer/search.rst](https://github.com/uccser/cs-unplugged/blob/issue/799/docs/source/developer/search.rst)\r\n\r\n### Conditional on line 52 of `csunplugged/search/views.py`\r\n\r\nI tried for many hours to set the model name for the model filter, and Django Haystack appears to be converting the model class name into text. I was reading through the Django Haystack source code and it appeared to take extensive rewriting of key functions to override this. It was much simplier to use a single conditional to replace the string with the desired text.\r\n\r\nFixes #799.","created_at":"2018-02-14T01:46:39Z","updated_at":"2018-02-14T20:57:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f65d04cf416137012c70dad35ad6b9c7c364e690","assignee":{"login":"JackMorganNZ","id":8001048,"avatar_url":"https://avatars3.githubusercontent.com/u/8001048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackMorganNZ","html_url":"https://github.com/JackMorganNZ","followers_url":"https://api.github.com/users/JackMorganNZ/followers","following_url":"https://api.github.com/users/JackMorganNZ/following{/other_user}","gists_url":"https://api.github.com/users/JackMorganNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/JackMorganNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackMorganNZ/subscriptions","organizations_url":"https://api.github.com/users/JackMorganNZ/orgs","repos_url":"https://api.github.com/users/JackMorganNZ/repos","events_url":"https://api.github.com/users/JackMorganNZ/events{/privacy}","received_events_url":"https://api.github.com/users/JackMorganNZ/received_events","type":"User","site_admin":false},"assignees":[{"login":"JackMorganNZ","id":8001048,"avatar_url":"https://avatars3.githubusercontent.com/u/8001048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackMorganNZ","html_url":"https://github.com/JackMorganNZ","followers_url":"https://api.github.com/users/JackMorganNZ/followers","following_url":"https://api.github.com/users/JackMorganNZ/following{/other_user}","gists_url":"https://api.github.com/users/JackMorganNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/JackMorganNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackMorganNZ/subscriptions","organizations_url":"https://api.github.com/users/JackMorganNZ/orgs","repos_url":"https://api.github.com/users/JackMorganNZ/repos","events_url":"https://api.github.com/users/JackMorganNZ/events{/privacy}","received_events_url":"https://api.github.com/users/JackMorganNZ/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":541675649,"url":"https://api.github.com/repos/uccser/cs-unplugged/labels/backend","name":"backend","color":"1d76db","default":false},{"id":553452375,"url":"https://api.github.com/repos/uccser/cs-unplugged/labels/content:%20other","name":"content: other","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886/commits","review_comments_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886/comments","review_comment_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/886/comments","statuses_url":"https://api.github.com/repos/uccser/cs-unplugged/statuses/355b73115abbf284025c063829a17c13047851bd","head":{"label":"uccser:issue/799","ref":"issue/799","sha":"355b73115abbf284025c063829a17c13047851bd","user":{"login":"uccser","id":12041506,"avatar_url":"https://avatars3.githubusercontent.com/u/12041506?v=4","gravatar_id":"","url":"https://api.github.com/users/uccser","html_url":"https://github.com/uccser","followers_url":"https://api.github.com/users/uccser/followers","following_url":"https://api.github.com/users/uccser/following{/other_user}","gists_url":"https://api.github.com/users/uccser/gists{/gist_id}","starred_url":"https://api.github.com/users/uccser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uccser/subscriptions","organizations_url":"https://api.github.com/users/uccser/orgs","repos_url":"https://api.github.com/users/uccser/repos","events_url":"https://api.github.com/users/uccser/events{/privacy}","received_events_url":"https://api.github.com/users/uccser/received_events","type":"Organization","site_admin":false},"repo":{"id":66315075,"name":"cs-unplugged","full_name":"uccser/cs-unplugged","owner":{"login":"uccser","id":12041506,"avatar_url":"https://avatars3.githubusercontent.com/u/12041506?v=4","gravatar_id":"","url":"https://api.github.com/users/uccser","html_url":"https://github.com/uccser","followers_url":"https://api.github.com/users/uccser/followers","following_url":"https://api.github.com/users/uccser/following{/other_user}","gists_url":"https://api.github.com/users/uccser/gists{/gist_id}","starred_url":"https://api.github.com/users/uccser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uccser/subscriptions","organizations_url":"https://api.github.com/users/uccser/orgs","repos_url":"https://api.github.com/users/uccser/repos","events_url":"https://api.github.com/users/uccser/events{/privacy}","received_events_url":"https://api.github.com/users/uccser/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uccser/cs-unplugged","description":"CS Unplugged is a collection of free teaching material that teaches Computer Science through engaging games and puzzles that use cards, string, crayons and lots of running around. ","fork":false,"url":"https://api.github.com/repos/uccser/cs-unplugged","forks_url":"https://api.github.com/repos/uccser/cs-unplugged/forks","keys_url":"https://api.github.com/repos/uccser/cs-unplugged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uccser/cs-unplugged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uccser/cs-unplugged/teams","hooks_url":"https://api.github.com/repos/uccser/cs-unplugged/hooks","issue_events_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/events{/number}","events_url":"https://api.github.com/repos/uccser/cs-unplugged/events","assignees_url":"https://api.github.com/repos/uccser/cs-unplugged/assignees{/user}","branches_url":"https://api.github.com/repos/uccser/cs-unplugged/branches{/branch}","tags_url":"https://api.github.com/repos/uccser/cs-unplugged/tags","blobs_url":"https://api.github.com/repos/uccser/cs-unplugged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uccser/cs-unplugged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uccser/cs-unplugged/git/refs{/sha}","trees_url":"https://api.github.com/repos/uccser/cs-unplugged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uccser/cs-unplugged/statuses/{sha}","languages_url":"https://api.github.com/repos/uccser/cs-unplugged/languages","stargazers_url":"https://api.github.com/repos/uccser/cs-unplugged/stargazers","contributors_url":"https://api.github.com/repos/uccser/cs-unplugged/contributors","subscribers_url":"https://api.github.com/repos/uccser/cs-unplugged/subscribers","subscription_url":"https://api.github.com/repos/uccser/cs-unplugged/subscription","commits_url":"https://api.github.com/repos/uccser/cs-unplugged/commits{/sha}","git_commits_url":"https://api.github.com/repos/uccser/cs-unplugged/git/commits{/sha}","comments_url":"https://api.github.com/repos/uccser/cs-unplugged/comments{/number}","issue_comment_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/comments{/number}","contents_url":"https://api.github.com/repos/uccser/cs-unplugged/contents/{+path}","compare_url":"https://api.github.com/repos/uccser/cs-unplugged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uccser/cs-unplugged/merges","archive_url":"https://api.github.com/repos/uccser/cs-unplugged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uccser/cs-unplugged/downloads","issues_url":"https://api.github.com/repos/uccser/cs-unplugged/issues{/number}","pulls_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls{/number}","milestones_url":"https://api.github.com/repos/uccser/cs-unplugged/milestones{/number}","notifications_url":"https://api.github.com/repos/uccser/cs-unplugged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uccser/cs-unplugged/labels{/name}","releases_url":"https://api.github.com/repos/uccser/cs-unplugged/releases{/id}","deployments_url":"https://api.github.com/repos/uccser/cs-unplugged/deployments","created_at":"2016-08-22T23:16:40Z","updated_at":"2018-02-10T09:16:48Z","pushed_at":"2018-02-14T19:04:24Z","git_url":"git://github.com/uccser/cs-unplugged.git","ssh_url":"git@github.com:uccser/cs-unplugged.git","clone_url":"https://github.com/uccser/cs-unplugged.git","svn_url":"https://github.com/uccser/cs-unplugged","homepage":"https://www.csunplugged.org","size":88592,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":92,"license":null,"forks":4,"open_issues":92,"watchers":27,"default_branch":"develop"}},"base":{"label":"uccser:develop","ref":"develop","sha":"1d2fe78ee937e13e7c77a0f6c75c97daa20ca56b","user":{"login":"uccser","id":12041506,"avatar_url":"https://avatars3.githubusercontent.com/u/12041506?v=4","gravatar_id":"","url":"https://api.github.com/users/uccser","html_url":"https://github.com/uccser","followers_url":"https://api.github.com/users/uccser/followers","following_url":"https://api.github.com/users/uccser/following{/other_user}","gists_url":"https://api.github.com/users/uccser/gists{/gist_id}","starred_url":"https://api.github.com/users/uccser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uccser/subscriptions","organizations_url":"https://api.github.com/users/uccser/orgs","repos_url":"https://api.github.com/users/uccser/repos","events_url":"https://api.github.com/users/uccser/events{/privacy}","received_events_url":"https://api.github.com/users/uccser/received_events","type":"Organization","site_admin":false},"repo":{"id":66315075,"name":"cs-unplugged","full_name":"uccser/cs-unplugged","owner":{"login":"uccser","id":12041506,"avatar_url":"https://avatars3.githubusercontent.com/u/12041506?v=4","gravatar_id":"","url":"https://api.github.com/users/uccser","html_url":"https://github.com/uccser","followers_url":"https://api.github.com/users/uccser/followers","following_url":"https://api.github.com/users/uccser/following{/other_user}","gists_url":"https://api.github.com/users/uccser/gists{/gist_id}","starred_url":"https://api.github.com/users/uccser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uccser/subscriptions","organizations_url":"https://api.github.com/users/uccser/orgs","repos_url":"https://api.github.com/users/uccser/repos","events_url":"https://api.github.com/users/uccser/events{/privacy}","received_events_url":"https://api.github.com/users/uccser/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uccser/cs-unplugged","description":"CS Unplugged is a collection of free teaching material that teaches Computer Science through engaging games and puzzles that use cards, string, crayons and lots of running around. ","fork":false,"url":"https://api.github.com/repos/uccser/cs-unplugged","forks_url":"https://api.github.com/repos/uccser/cs-unplugged/forks","keys_url":"https://api.github.com/repos/uccser/cs-unplugged/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uccser/cs-unplugged/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uccser/cs-unplugged/teams","hooks_url":"https://api.github.com/repos/uccser/cs-unplugged/hooks","issue_events_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/events{/number}","events_url":"https://api.github.com/repos/uccser/cs-unplugged/events","assignees_url":"https://api.github.com/repos/uccser/cs-unplugged/assignees{/user}","branches_url":"https://api.github.com/repos/uccser/cs-unplugged/branches{/branch}","tags_url":"https://api.github.com/repos/uccser/cs-unplugged/tags","blobs_url":"https://api.github.com/repos/uccser/cs-unplugged/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uccser/cs-unplugged/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uccser/cs-unplugged/git/refs{/sha}","trees_url":"https://api.github.com/repos/uccser/cs-unplugged/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uccser/cs-unplugged/statuses/{sha}","languages_url":"https://api.github.com/repos/uccser/cs-unplugged/languages","stargazers_url":"https://api.github.com/repos/uccser/cs-unplugged/stargazers","contributors_url":"https://api.github.com/repos/uccser/cs-unplugged/contributors","subscribers_url":"https://api.github.com/repos/uccser/cs-unplugged/subscribers","subscription_url":"https://api.github.com/repos/uccser/cs-unplugged/subscription","commits_url":"https://api.github.com/repos/uccser/cs-unplugged/commits{/sha}","git_commits_url":"https://api.github.com/repos/uccser/cs-unplugged/git/commits{/sha}","comments_url":"https://api.github.com/repos/uccser/cs-unplugged/comments{/number}","issue_comment_url":"https://api.github.com/repos/uccser/cs-unplugged/issues/comments{/number}","contents_url":"https://api.github.com/repos/uccser/cs-unplugged/contents/{+path}","compare_url":"https://api.github.com/repos/uccser/cs-unplugged/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uccser/cs-unplugged/merges","archive_url":"https://api.github.com/repos/uccser/cs-unplugged/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uccser/cs-unplugged/downloads","issues_url":"https://api.github.com/repos/uccser/cs-unplugged/issues{/number}","pulls_url":"https://api.github.com/repos/uccser/cs-unplugged/pulls{/number}","milestones_url":"https://api.github.com/repos/uccser/cs-unplugged/milestones{/number}","notifications_url":"https://api.github.com/repos/uccser/cs-unplugged/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uccser/cs-unplugged/labels{/name}","releases_url":"https://api.github.com/repos/uccser/cs-unplugged/releases{/id}","deployments_url":"https://api.github.com/repos/uccser/cs-unplugged/deployments","created_at":"2016-08-22T23:16:40Z","updated_at":"2018-02-10T09:16:48Z","pushed_at":"2018-02-14T19:04:24Z","git_url":"git://github.com/uccser/cs-unplugged.git","ssh_url":"git@github.com:uccser/cs-unplugged.git","clone_url":"https://github.com/uccser/cs-unplugged.git","svn_url":"https://github.com/uccser/cs-unplugged","homepage":"https://www.csunplugged.org","size":88592,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":92,"license":null,"forks":4,"open_issues":92,"watchers":27,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886"},"html":{"href":"https://github.com/uccser/cs-unplugged/pull/886"},"issue":{"href":"https://api.github.com/repos/uccser/cs-unplugged/issues/886"},"comments":{"href":"https://api.github.com/repos/uccser/cs-unplugged/issues/886/comments"},"review_comments":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886/comments"},"review_comment":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uccser/cs-unplugged/pulls/886/commits"},"statuses":{"href":"https://api.github.com/repos/uccser/cs-unplugged/statuses/355b73115abbf284025c063829a17c13047851bd"}},"author_association":"OWNER"}}
{"actor":{"display_login":"hayleyavw"}}