{"action":"created","comment":{"url":"https://api.github.com/repos/ITNG/worklog/pulls/comments/23470225","id":23470225,"diff_hunk":"@@ -121,67 +119,73 @@ def get_redirect_url(self, *args, **kwargs):\n \n \n class WorkItemView(TemplateView):\n-    pass\n-\n-\n-class CurrentDateRedirectView(RedirectView):\n-    permanent = False\n+    WorkItemFormSet = modelformset_factory(WorkItem, form=WorkItemForm, formset=WorkItemBaseFormSet)\n \n-    def get_redirect_url(self, *args, **kwargs):\n-        return reverse('worklog-date', kwargs={'date': str(datetime.date.today())})\n+    def workitem_response(self, request, date, formset):\n+        items = WorkItem.objects.filter(date=date, user=request.user)\n+        rawitems = list(tuple(_itercolumns(item)) for item in items)\n \n+        if BiweeklyEmployee.objects.filter(user=request.user).count() > 0:\n+            holidays = Holiday.objects.filter(start_date__gte=date, end_date__lte=date)\n+        else:\n+            holidays = None\n+\n+        return render_to_response('worklog/workform.html',\n+                {\n+                    'open': formset,\n+                    'date': date,\n+                    'items': rawitems,\n+                    'column_names': list(t for k, t in _column_layout),\n+                    'holidays': holidays\n+                },\n+                    context_instance = RequestContext(request)\n+                )\n \n-def createWorkItem(request, date='today'):\n-    WorkItemFormSet = modelformset_factory(WorkItem, form=WorkItemForm, formset=WorkItemBaseFormSet)\n+    def get_context_data(self, **kwargs):\n+        date = kwargs['date']\n+        if date == 'today' or date == None:\n+            date = datetime.date.today()\n+        else:\n+            date = datetime.datetime.strptime(date, '%Y-%m-%d').date()\n \n-    if date == 'today':\n-        date = datetime.date.today()\n-    else:\n-        date = datetime.datetime.strptime(date, '%Y-%m-%d').date()\n+        context = super(WorkItemView, self).get_context_data()\n+        context['date'] = date\n \n-    if request.method == 'POST':  # If the form has been submitted...\n+        return context\n \n-        formset = WorkItemFormSet(request.POST, logged_in_user=request.user)\n+    def post(self, request, *args, **kwargs):","path":"worklog/views.py","position":90,"original_position":90,"commit_id":"1d661fd2e339f5371a3120b6c274dde39ede8647","original_commit_id":"1d661fd2e339f5371a3120b6c274dde39ede8647","user":{"login":"rpkilby","id":2370209,"avatar_url":"https://avatars.githubusercontent.com/u/2370209?v=3","gravatar_id":"","url":"https://api.github.com/users/rpkilby","html_url":"https://github.com/rpkilby","followers_url":"https://api.github.com/users/rpkilby/followers","following_url":"https://api.github.com/users/rpkilby/following{/other_user}","gists_url":"https://api.github.com/users/rpkilby/gists{/gist_id}","starred_url":"https://api.github.com/users/rpkilby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpkilby/subscriptions","organizations_url":"https://api.github.com/users/rpkilby/orgs","repos_url":"https://api.github.com/users/rpkilby/repos","events_url":"https://api.github.com/users/rpkilby/events{/privacy}","received_events_url":"https://api.github.com/users/rpkilby/received_events","type":"User","site_admin":false},"body":"I think this function is no longer relevant? It should effectively be replaced by the API.","created_at":"2015-01-23T18:46:41Z","updated_at":"2015-01-23T18:46:41Z","html_url":"https://github.com/ITNG/worklog/pull/30#discussion_r23470225","pull_request_url":"https://api.github.com/repos/ITNG/worklog/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/comments/23470225"},"html":{"href":"https://github.com/ITNG/worklog/pull/30#discussion_r23470225"},"pull_request":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/ITNG/worklog/pulls/30","id":27439740,"html_url":"https://github.com/ITNG/worklog/pull/30","diff_url":"https://github.com/ITNG/worklog/pull/30.diff","patch_url":"https://github.com/ITNG/worklog/pull/30.patch","issue_url":"https://api.github.com/repos/ITNG/worklog/issues/30","number":30,"state":"open","locked":false,"title":"01 worklog cbv","user":{"login":"tahege","id":10224778,"avatar_url":"https://avatars.githubusercontent.com/u/10224778?v=3","gravatar_id":"","url":"https://api.github.com/users/tahege","html_url":"https://github.com/tahege","followers_url":"https://api.github.com/users/tahege/followers","following_url":"https://api.github.com/users/tahege/following{/other_user}","gists_url":"https://api.github.com/users/tahege/gists{/gist_id}","starred_url":"https://api.github.com/users/tahege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tahege/subscriptions","organizations_url":"https://api.github.com/users/tahege/orgs","repos_url":"https://api.github.com/users/tahege/repos","events_url":"https://api.github.com/users/tahege/events{/privacy}","received_events_url":"https://api.github.com/users/tahege/received_events","type":"User","site_admin":false},"body":"Converted the views for adding work items and for viewing work log history, from function based views to class-based views. Along with test to ensure that the correct information is being displayed.","created_at":"2015-01-15T16:11:09Z","updated_at":"2015-01-23T18:46:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f7353abc5b38366f9bb7ffb78d4cfd791c253f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ITNG/worklog/pulls/30/commits","review_comments_url":"https://api.github.com/repos/ITNG/worklog/pulls/30/comments","review_comment_url":"https://api.github.com/repos/ITNG/worklog/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ITNG/worklog/issues/30/comments","statuses_url":"https://api.github.com/repos/ITNG/worklog/statuses/1d661fd2e339f5371a3120b6c274dde39ede8647","head":{"label":"ITNG:01-worklogCBV","ref":"01-worklogCBV","sha":"1d661fd2e339f5371a3120b6c274dde39ede8647","user":{"login":"ITNG","id":1881065,"avatar_url":"https://avatars.githubusercontent.com/u/1881065?v=3","gravatar_id":"","url":"https://api.github.com/users/ITNG","html_url":"https://github.com/ITNG","followers_url":"https://api.github.com/users/ITNG/followers","following_url":"https://api.github.com/users/ITNG/following{/other_user}","gists_url":"https://api.github.com/users/ITNG/gists{/gist_id}","starred_url":"https://api.github.com/users/ITNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ITNG/subscriptions","organizations_url":"https://api.github.com/users/ITNG/orgs","repos_url":"https://api.github.com/users/ITNG/repos","events_url":"https://api.github.com/users/ITNG/events{/privacy}","received_events_url":"https://api.github.com/users/ITNG/received_events","type":"Organization","site_admin":false},"repo":{"id":4784845,"name":"worklog","full_name":"ITNG/worklog","owner":{"login":"ITNG","id":1881065,"avatar_url":"https://avatars.githubusercontent.com/u/1881065?v=3","gravatar_id":"","url":"https://api.github.com/users/ITNG","html_url":"https://github.com/ITNG","followers_url":"https://api.github.com/users/ITNG/followers","following_url":"https://api.github.com/users/ITNG/following{/other_user}","gists_url":"https://api.github.com/users/ITNG/gists{/gist_id}","starred_url":"https://api.github.com/users/ITNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ITNG/subscriptions","organizations_url":"https://api.github.com/users/ITNG/orgs","repos_url":"https://api.github.com/users/ITNG/repos","events_url":"https://api.github.com/users/ITNG/events{/privacy}","received_events_url":"https://api.github.com/users/ITNG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ITNG/worklog","description":"A Django based, hourly work logging app which supports job coding, view filtering, csv report generation and an e-mail reminder system","fork":true,"url":"https://api.github.com/repos/ITNG/worklog","forks_url":"https://api.github.com/repos/ITNG/worklog/forks","keys_url":"https://api.github.com/repos/ITNG/worklog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ITNG/worklog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ITNG/worklog/teams","hooks_url":"https://api.github.com/repos/ITNG/worklog/hooks","issue_events_url":"https://api.github.com/repos/ITNG/worklog/issues/events{/number}","events_url":"https://api.github.com/repos/ITNG/worklog/events","assignees_url":"https://api.github.com/repos/ITNG/worklog/assignees{/user}","branches_url":"https://api.github.com/repos/ITNG/worklog/branches{/branch}","tags_url":"https://api.github.com/repos/ITNG/worklog/tags","blobs_url":"https://api.github.com/repos/ITNG/worklog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ITNG/worklog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ITNG/worklog/git/refs{/sha}","trees_url":"https://api.github.com/repos/ITNG/worklog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ITNG/worklog/statuses/{sha}","languages_url":"https://api.github.com/repos/ITNG/worklog/languages","stargazers_url":"https://api.github.com/repos/ITNG/worklog/stargazers","contributors_url":"https://api.github.com/repos/ITNG/worklog/contributors","subscribers_url":"https://api.github.com/repos/ITNG/worklog/subscribers","subscription_url":"https://api.github.com/repos/ITNG/worklog/subscription","commits_url":"https://api.github.com/repos/ITNG/worklog/commits{/sha}","git_commits_url":"https://api.github.com/repos/ITNG/worklog/git/commits{/sha}","comments_url":"https://api.github.com/repos/ITNG/worklog/comments{/number}","issue_comment_url":"https://api.github.com/repos/ITNG/worklog/issues/comments/{number}","contents_url":"https://api.github.com/repos/ITNG/worklog/contents/{+path}","compare_url":"https://api.github.com/repos/ITNG/worklog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ITNG/worklog/merges","archive_url":"https://api.github.com/repos/ITNG/worklog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ITNG/worklog/downloads","issues_url":"https://api.github.com/repos/ITNG/worklog/issues{/number}","pulls_url":"https://api.github.com/repos/ITNG/worklog/pulls{/number}","milestones_url":"https://api.github.com/repos/ITNG/worklog/milestones{/number}","notifications_url":"https://api.github.com/repos/ITNG/worklog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ITNG/worklog/labels{/name}","releases_url":"https://api.github.com/repos/ITNG/worklog/releases{/id}","created_at":"2012-06-25T17:31:43Z","updated_at":"2015-01-23T17:58:35Z","pushed_at":"2015-01-23T17:58:34Z","git_url":"git://github.com/ITNG/worklog.git","ssh_url":"git@github.com:ITNG/worklog.git","clone_url":"https://github.com/ITNG/worklog.git","svn_url":"https://github.com/ITNG/worklog","homepage":"","size":14342,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"ITNG:master","ref":"master","sha":"213d19d9075685731daf6f87f8cd6bec3f44e61a","user":{"login":"ITNG","id":1881065,"avatar_url":"https://avatars.githubusercontent.com/u/1881065?v=3","gravatar_id":"","url":"https://api.github.com/users/ITNG","html_url":"https://github.com/ITNG","followers_url":"https://api.github.com/users/ITNG/followers","following_url":"https://api.github.com/users/ITNG/following{/other_user}","gists_url":"https://api.github.com/users/ITNG/gists{/gist_id}","starred_url":"https://api.github.com/users/ITNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ITNG/subscriptions","organizations_url":"https://api.github.com/users/ITNG/orgs","repos_url":"https://api.github.com/users/ITNG/repos","events_url":"https://api.github.com/users/ITNG/events{/privacy}","received_events_url":"https://api.github.com/users/ITNG/received_events","type":"Organization","site_admin":false},"repo":{"id":4784845,"name":"worklog","full_name":"ITNG/worklog","owner":{"login":"ITNG","id":1881065,"avatar_url":"https://avatars.githubusercontent.com/u/1881065?v=3","gravatar_id":"","url":"https://api.github.com/users/ITNG","html_url":"https://github.com/ITNG","followers_url":"https://api.github.com/users/ITNG/followers","following_url":"https://api.github.com/users/ITNG/following{/other_user}","gists_url":"https://api.github.com/users/ITNG/gists{/gist_id}","starred_url":"https://api.github.com/users/ITNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ITNG/subscriptions","organizations_url":"https://api.github.com/users/ITNG/orgs","repos_url":"https://api.github.com/users/ITNG/repos","events_url":"https://api.github.com/users/ITNG/events{/privacy}","received_events_url":"https://api.github.com/users/ITNG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ITNG/worklog","description":"A Django based, hourly work logging app which supports job coding, view filtering, csv report generation and an e-mail reminder system","fork":true,"url":"https://api.github.com/repos/ITNG/worklog","forks_url":"https://api.github.com/repos/ITNG/worklog/forks","keys_url":"https://api.github.com/repos/ITNG/worklog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ITNG/worklog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ITNG/worklog/teams","hooks_url":"https://api.github.com/repos/ITNG/worklog/hooks","issue_events_url":"https://api.github.com/repos/ITNG/worklog/issues/events{/number}","events_url":"https://api.github.com/repos/ITNG/worklog/events","assignees_url":"https://api.github.com/repos/ITNG/worklog/assignees{/user}","branches_url":"https://api.github.com/repos/ITNG/worklog/branches{/branch}","tags_url":"https://api.github.com/repos/ITNG/worklog/tags","blobs_url":"https://api.github.com/repos/ITNG/worklog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ITNG/worklog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ITNG/worklog/git/refs{/sha}","trees_url":"https://api.github.com/repos/ITNG/worklog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ITNG/worklog/statuses/{sha}","languages_url":"https://api.github.com/repos/ITNG/worklog/languages","stargazers_url":"https://api.github.com/repos/ITNG/worklog/stargazers","contributors_url":"https://api.github.com/repos/ITNG/worklog/contributors","subscribers_url":"https://api.github.com/repos/ITNG/worklog/subscribers","subscription_url":"https://api.github.com/repos/ITNG/worklog/subscription","commits_url":"https://api.github.com/repos/ITNG/worklog/commits{/sha}","git_commits_url":"https://api.github.com/repos/ITNG/worklog/git/commits{/sha}","comments_url":"https://api.github.com/repos/ITNG/worklog/comments{/number}","issue_comment_url":"https://api.github.com/repos/ITNG/worklog/issues/comments/{number}","contents_url":"https://api.github.com/repos/ITNG/worklog/contents/{+path}","compare_url":"https://api.github.com/repos/ITNG/worklog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ITNG/worklog/merges","archive_url":"https://api.github.com/repos/ITNG/worklog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ITNG/worklog/downloads","issues_url":"https://api.github.com/repos/ITNG/worklog/issues{/number}","pulls_url":"https://api.github.com/repos/ITNG/worklog/pulls{/number}","milestones_url":"https://api.github.com/repos/ITNG/worklog/milestones{/number}","notifications_url":"https://api.github.com/repos/ITNG/worklog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ITNG/worklog/labels{/name}","releases_url":"https://api.github.com/repos/ITNG/worklog/releases{/id}","created_at":"2012-06-25T17:31:43Z","updated_at":"2015-01-23T17:58:35Z","pushed_at":"2015-01-23T17:58:34Z","git_url":"git://github.com/ITNG/worklog.git","ssh_url":"git@github.com:ITNG/worklog.git","clone_url":"https://github.com/ITNG/worklog.git","svn_url":"https://github.com/ITNG/worklog","homepage":"","size":14342,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/30"},"html":{"href":"https://github.com/ITNG/worklog/pull/30"},"issue":{"href":"https://api.github.com/repos/ITNG/worklog/issues/30"},"comments":{"href":"https://api.github.com/repos/ITNG/worklog/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ITNG/worklog/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/ITNG/worklog/statuses/1d661fd2e339f5371a3120b6c274dde39ede8647"}}}}