GitHub PullRequestReviewCommentEvent at 2014-10-17 15:43:00
Repository: MyJobs
Actor: aspidites
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/19025181","id":19025181,"diff_hunk":"@@ -0,0 +1,331 @@\n+from django.conf import settings\n+from django.contrib.auth import authenticate\n+from django.contrib.contenttypes.models import ContentType\n+from django.core.urlresolvers import reverse\n+from django.db import models\n+from django.http import HttpResponseRedirect\n+from django.template import RequestContext\n+from django.template.loader import render_to_string\n+from django.utils.safestring import mark_safe\n+\n+from myblocks.helpers import get_jobs, success_url\n+from myjobs.helpers import expire_login\n+from myjobs.models import User\n+from registration.forms import CustomAuthForm, RegistrationForm\n+\n+\n+class Block(models.Model):\n+    content_type = models.ForeignKey(ContentType)\n+    name = models.CharField(max_length=255)\n+    offset = models.PositiveIntegerField()\n+    span = models.PositiveIntegerField()\n+\n+    def __unicode__(self):\n+        return self.name\n+\n+    def _get_real_type(self):\n+        return ContentType.objects.get_for_model(type(self))\n+\n+    def bootstrap_classes(self):\n+        offset = \"offset%s\" % self.offset if self.offset else ''\n+        span = \"span%s\" % self.span if self.span else ''\n+\n+        return \"%s %s\" % (offset, span)\n+\n+    def block_size(self):\n+        return self.offset + self.span\n+\n+    def cast(self):\n+        return self.content_type.get_object_for_this_type(pk=self.pk)\n+\n+    def context(self, request):\n+        return {\n+            'block': self,\n+            'request': request\n+        }\n+\n+    def render(self, request):\n+        html = render_to_string(self.cast().template(), self.context(request),\n+                                context_instance=RequestContext(request))\n+        return mark_safe(html)\n+\n+    def save(self, *args, **kwargs):\n+        if not self.id:\n+            self.content_type = self._get_real_type()\n+        super(Block, self).save(*args, **kwargs)\n+\n+\n+class ContentBlock(Block):\n+    content = models.TextField()\n+\n+    @staticmethod\n+    def template():\n+        return 'myblocks/blocks/content.html'\n+\n+\n+class ImageBlock(Block):\n+    image_url = models.URLField(max_length=200)\n+\n+    def context(self, request):\n+        return {\n+            'block': self,\n+            'request': request,\n+            'site': settings.SITE,\n+        }\n+\n+    @staticmethod\n+    def template():\n+        return 'myblocks/blocks/image.html'\n+\n+\n+class LoginBlock(Block):\n+    def context(self, request):\n+        querystring = \"?%s\" % request.META.get('QUERY_STRING')\n+        if request.POST and self.submit_btn_name() in request.POST:\n+            return {\n+                'action': querystring,\n+                'block': self,\n+                'login_form': CustomAuthForm(data=request.POST),\n+                'request': request,\n+            }\n+        return {\n+            'action': querystring,\n+            'block': self,\n+            'login_form': CustomAuthForm(),\n+            'request': request,\n+        }\n+\n+    def handle_post(self, request):","path":"myblocks/models.py","position":97,"original_position":98,"commit_id":"00e7f2469c98e1cb0024d88a0b1ff1fb66413ca9","original_commit_id":"275790a48c99d1dcbeecfbb52742c771e8840da7","user":{"login":"aspidites","id":93686,"avatar_url":"https://avatars.githubusercontent.com/u/93686?v=2","gravatar_id":"","url":"https://api.github.com/users/aspidites","html_url":"https://github.com/aspidites","followers_url":"https://api.github.com/users/aspidites/followers","following_url":"https://api.github.com/users/aspidites/following{/other_user}","gists_url":"https://api.github.com/users/aspidites/gists{/gist_id}","starred_url":"https://api.github.com/users/aspidites/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspidites/subscriptions","organizations_url":"https://api.github.com/users/aspidites/orgs","repos_url":"https://api.github.com/users/aspidites/repos","events_url":"https://api.github.com/users/aspidites/events{/privacy}","received_events_url":"https://api.github.com/users/aspidites/received_events","type":"User","site_admin":false},"body":"I see. Block as in myblock, not template blocks, right?","created_at":"2014-10-17T15:43:00Z","updated_at":"2014-10-17T15:43:00Z","html_url":"https://github.com/DirectEmployers/MyJobs/pull/955#discussion_r19025181","pull_request_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955","_links":{"self":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/19025181"},"html":{"href":"https://github.com/DirectEmployers/MyJobs/pull/955#discussion_r19025181"},"pull_request":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955"}}},"pull_request":{"url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955","id":22883064,"html_url":"https://github.com/DirectEmployers/MyJobs/pull/955","diff_url":"https://github.com/DirectEmployers/MyJobs/pull/955.diff","patch_url":"https://github.com/DirectEmployers/MyJobs/pull/955.patch","issue_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/955","number":955,"state":"open","locked":false,"title":"Login templates","user":{"login":"almathew","id":2728248,"avatar_url":"https://avatars.githubusercontent.com/u/2728248?v=2","gravatar_id":"","url":"https://api.github.com/users/almathew","html_url":"https://github.com/almathew","followers_url":"https://api.github.com/users/almathew/followers","following_url":"https://api.github.com/users/almathew/following{/other_user}","gists_url":"https://api.github.com/users/almathew/gists{/gist_id}","starred_url":"https://api.github.com/users/almathew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almathew/subscriptions","organizations_url":"https://api.github.com/users/almathew/orgs","repos_url":"https://api.github.com/users/almathew/repos","events_url":"https://api.github.com/users/almathew/events{/privacy}","received_events_url":"https://api.github.com/users/almathew/received_events","type":"User","site_admin":false},"body":"Basic blocks, specifically fully working login, registration, image, and content blocks. Specified blocks are working except for:\r\n- I think the CSS needs moved. \r\n- Default fixtures.\r\n- Tests.\r\n- Easy to use admin.\r\n\r\nPlease review.\r\n\r\n**Important Note**: All html is assume safe. This is probably not non-very-very-trusted user friendly.","created_at":"2014-10-16T20:14:58Z","updated_at":"2014-10-17T15:43:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"691214d569b1e28ea1c912a312e4830eaa777d56","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955/commits","review_comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955/comments","review_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/955/comments","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/00e7f2469c98e1cb0024d88a0b1ff1fb66413ca9","head":{"label":"DirectEmployers:login-templates","ref":"login-templates","sha":"00e7f2469c98e1cb0024d88a0b1ff1fb66413ca9","user":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=2","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"repo":{"id":2867982,"name":"MyJobs","full_name":"DirectEmployers/MyJobs","owner":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=2","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DirectEmployers/MyJobs","description":"Multi-user website designed to assist job seekers in their search for employment","fork":false,"url":"https://api.github.com/repos/DirectEmployers/MyJobs","forks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/forks","keys_url":"https://api.github.com/repos/DirectEmployers/MyJobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DirectEmployers/MyJobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DirectEmployers/MyJobs/teams","hooks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/hooks","issue_events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/events{/number}","events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/events","assignees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/assignees{/user}","branches_url":"https://api.github.com/repos/DirectEmployers/MyJobs/branches{/branch}","tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/tags","blobs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/{sha}","languages_url":"https://api.github.com/repos/DirectEmployers/MyJobs/languages","stargazers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/stargazers","contributors_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contributors","subscribers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscribers","subscription_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscription","commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/comments/{number}","contents_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contents/{+path}","compare_url":"https://api.github.com/repos/DirectEmployers/MyJobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DirectEmployers/MyJobs/merges","archive_url":"https://api.github.com/repos/DirectEmployers/MyJobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DirectEmployers/MyJobs/downloads","issues_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues{/number}","pulls_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls{/number}","milestones_url":"https://api.github.com/repos/DirectEmployers/MyJobs/milestones{/number}","notifications_url":"https://api.github.com/repos/DirectEmployers/MyJobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DirectEmployers/MyJobs/labels{/name}","releases_url":"https://api.github.com/repos/DirectEmployers/MyJobs/releases{/id}","created_at":"2011-11-28T15:22:36Z","updated_at":"2014-09-03T17:11:09Z","pushed_at":"2014-10-17T15:41:39Z","git_url":"git://github.com/DirectEmployers/MyJobs.git","ssh_url":"git@github.com:DirectEmployers/MyJobs.git","clone_url":"https://github.com/DirectEmployers/MyJobs.git","svn_url":"https://github.com/DirectEmployers/MyJobs","homepage":"http://my.jobs","size":33712,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":6,"forks":5,"open_issues":6,"watchers":3,"default_branch":"master"}},"base":{"label":"DirectEmployers:FEATURE-postajob","ref":"FEATURE-postajob","sha":"60eae60a72a58171a44401469394c04eadf1da91","user":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=2","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"repo":{"id":2867982,"name":"MyJobs","full_name":"DirectEmployers/MyJobs","owner":{"login":"DirectEmployers","id":381171,"avatar_url":"https://avatars.githubusercontent.com/u/381171?v=2","gravatar_id":"","url":"https://api.github.com/users/DirectEmployers","html_url":"https://github.com/DirectEmployers","followers_url":"https://api.github.com/users/DirectEmployers/followers","following_url":"https://api.github.com/users/DirectEmployers/following{/other_user}","gists_url":"https://api.github.com/users/DirectEmployers/gists{/gist_id}","starred_url":"https://api.github.com/users/DirectEmployers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DirectEmployers/subscriptions","organizations_url":"https://api.github.com/users/DirectEmployers/orgs","repos_url":"https://api.github.com/users/DirectEmployers/repos","events_url":"https://api.github.com/users/DirectEmployers/events{/privacy}","received_events_url":"https://api.github.com/users/DirectEmployers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DirectEmployers/MyJobs","description":"Multi-user website designed to assist job seekers in their search for employment","fork":false,"url":"https://api.github.com/repos/DirectEmployers/MyJobs","forks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/forks","keys_url":"https://api.github.com/repos/DirectEmployers/MyJobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DirectEmployers/MyJobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DirectEmployers/MyJobs/teams","hooks_url":"https://api.github.com/repos/DirectEmployers/MyJobs/hooks","issue_events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/events{/number}","events_url":"https://api.github.com/repos/DirectEmployers/MyJobs/events","assignees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/assignees{/user}","branches_url":"https://api.github.com/repos/DirectEmployers/MyJobs/branches{/branch}","tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/tags","blobs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/{sha}","languages_url":"https://api.github.com/repos/DirectEmployers/MyJobs/languages","stargazers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/stargazers","contributors_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contributors","subscribers_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscribers","subscription_url":"https://api.github.com/repos/DirectEmployers/MyJobs/subscription","commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/DirectEmployers/MyJobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/DirectEmployers/MyJobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/comments/{number}","contents_url":"https://api.github.com/repos/DirectEmployers/MyJobs/contents/{+path}","compare_url":"https://api.github.com/repos/DirectEmployers/MyJobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DirectEmployers/MyJobs/merges","archive_url":"https://api.github.com/repos/DirectEmployers/MyJobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DirectEmployers/MyJobs/downloads","issues_url":"https://api.github.com/repos/DirectEmployers/MyJobs/issues{/number}","pulls_url":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls{/number}","milestones_url":"https://api.github.com/repos/DirectEmployers/MyJobs/milestones{/number}","notifications_url":"https://api.github.com/repos/DirectEmployers/MyJobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DirectEmployers/MyJobs/labels{/name}","releases_url":"https://api.github.com/repos/DirectEmployers/MyJobs/releases{/id}","created_at":"2011-11-28T15:22:36Z","updated_at":"2014-09-03T17:11:09Z","pushed_at":"2014-10-17T15:41:39Z","git_url":"git://github.com/DirectEmployers/MyJobs.git","ssh_url":"git@github.com:DirectEmployers/MyJobs.git","clone_url":"https://github.com/DirectEmployers/MyJobs.git","svn_url":"https://github.com/DirectEmployers/MyJobs","homepage":"http://my.jobs","size":33712,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":6,"forks":5,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955"},"html":{"href":"https://github.com/DirectEmployers/MyJobs/pull/955"},"issue":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/955"},"comments":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/issues/955/comments"},"review_comments":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955/comments"},"review_comment":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/pulls/955/commits"},"statuses":{"href":"https://api.github.com/repos/DirectEmployers/MyJobs/statuses/00e7f2469c98e1cb0024d88a0b1ff1fb66413ca9"}}}}