{"action":"created","comment":{"url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/comments/36941665","id":36941665,"diff_hunk":"@@ -1,10 +1,53 @@\n from django import forms\n \n-from .models import Project\n+\n+from .models import Project, Client, Entry\n+from django.db import models\n+from django.utils import timezone\n+\n+\n+\n \n \n class EntryForm(forms.Form):\n     start = forms.DateTimeField(label=\"Start Time\", help_text=\"Format: 2006-10-25 14:30\")\n     end = forms.DateTimeField(label=\"End Time\", help_text=\"Format: 2006-10-25 14:30\")\n     project = forms.ModelChoiceField(queryset=Project.objects.all())\n-    description = forms.CharField()\n+    description = forms.CharField(max_length=100)\n+\n+    def clean(self):\n+        cleaned_data = super(EntryForm, self).clean()\n+        start = self.cleaned_data.get('start')\n+        end = self.cleaned_data.get('end')\n+        now = timezone.now()\n+\n+        if start >= now or start >= end:\n+            raise forms.ValidationError(\"Start time must be in the past, end time must be after start time\")\n+        return cleaned_data\n+\n+#using these functions below would create a 'Nonetype() >= datetime()' error. The only way i could","path":"timetracker/entries/forms.py","position":30,"original_position":30,"commit_id":"c4079b9f52b251eafa3c8cec7e576231c3cfe588","original_commit_id":"c4079b9f52b251eafa3c8cec7e576231c3cfe588","user":{"login":"MarkusH","id":475613,"avatar_url":"https://avatars.githubusercontent.com/u/475613?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkusH","html_url":"https://github.com/MarkusH","followers_url":"https://api.github.com/users/MarkusH/followers","following_url":"https://api.github.com/users/MarkusH/following{/other_user}","gists_url":"https://api.github.com/users/MarkusH/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkusH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkusH/subscriptions","organizations_url":"https://api.github.com/users/MarkusH/orgs","repos_url":"https://api.github.com/users/MarkusH/repos","events_url":"https://api.github.com/users/MarkusH/events{/privacy}","received_events_url":"https://api.github.com/users/MarkusH/received_events","type":"User","site_admin":false},"body":"You'll see a complete solution once we published it. For now here are some tips:\r\n\r\n`clean()` is used when validating multiple fields that depend on each other. `clean_FIELDNAME()` is used when validating only the field itself (and it doesn't depend on others).","created_at":"2015-08-13T05:20:45Z","updated_at":"2015-08-13T05:20:45Z","html_url":"https://github.com/MelbDjango/lesson-four/pull/4#discussion_r36941665","pull_request_url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/comments/36941665"},"html":{"href":"https://github.com/MelbDjango/lesson-four/pull/4#discussion_r36941665"},"pull_request":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4","id":42087127,"html_url":"https://github.com/MelbDjango/lesson-four/pull/4","diff_url":"https://github.com/MelbDjango/lesson-four/pull/4.diff","patch_url":"https://github.com/MelbDjango/lesson-four/pull/4.patch","issue_url":"https://api.github.com/repos/MelbDjango/lesson-four/issues/4","number":4,"state":"open","locked":false,"title":"MDS homework week four","user":{"login":"AB-D","id":13411442,"avatar_url":"https://avatars.githubusercontent.com/u/13411442?v=3","gravatar_id":"","url":"https://api.github.com/users/AB-D","html_url":"https://github.com/AB-D","followers_url":"https://api.github.com/users/AB-D/followers","following_url":"https://api.github.com/users/AB-D/following{/other_user}","gists_url":"https://api.github.com/users/AB-D/gists{/gist_id}","starred_url":"https://api.github.com/users/AB-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AB-D/subscriptions","organizations_url":"https://api.github.com/users/AB-D/orgs","repos_url":"https://api.github.com/users/AB-D/repos","events_url":"https://api.github.com/users/AB-D/events{/privacy}","received_events_url":"https://api.github.com/users/AB-D/received_events","type":"User","site_admin":false},"body":"This seems to work, hopefully i will get some time to do the bonuses.\r\n\r\nThank you all.","created_at":"2015-08-11T02:31:14Z","updated_at":"2015-08-13T05:20:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"871b91d0c35cd89f8e2f1948701154cd0b6adbf6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4/commits","review_comments_url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4/comments","review_comment_url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MelbDjango/lesson-four/issues/4/comments","statuses_url":"https://api.github.com/repos/MelbDjango/lesson-four/statuses/c4079b9f52b251eafa3c8cec7e576231c3cfe588","head":{"label":"AB-D:master","ref":"master","sha":"c4079b9f52b251eafa3c8cec7e576231c3cfe588","user":{"login":"AB-D","id":13411442,"avatar_url":"https://avatars.githubusercontent.com/u/13411442?v=3","gravatar_id":"","url":"https://api.github.com/users/AB-D","html_url":"https://github.com/AB-D","followers_url":"https://api.github.com/users/AB-D/followers","following_url":"https://api.github.com/users/AB-D/following{/other_user}","gists_url":"https://api.github.com/users/AB-D/gists{/gist_id}","starred_url":"https://api.github.com/users/AB-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AB-D/subscriptions","organizations_url":"https://api.github.com/users/AB-D/orgs","repos_url":"https://api.github.com/users/AB-D/repos","events_url":"https://api.github.com/users/AB-D/events{/privacy}","received_events_url":"https://api.github.com/users/AB-D/received_events","type":"User","site_admin":false},"repo":{"id":40339421,"name":"lesson-four","full_name":"AB-D/lesson-four","owner":{"login":"AB-D","id":13411442,"avatar_url":"https://avatars.githubusercontent.com/u/13411442?v=3","gravatar_id":"","url":"https://api.github.com/users/AB-D","html_url":"https://github.com/AB-D","followers_url":"https://api.github.com/users/AB-D/followers","following_url":"https://api.github.com/users/AB-D/following{/other_user}","gists_url":"https://api.github.com/users/AB-D/gists{/gist_id}","starred_url":"https://api.github.com/users/AB-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AB-D/subscriptions","organizations_url":"https://api.github.com/users/AB-D/orgs","repos_url":"https://api.github.com/users/AB-D/repos","events_url":"https://api.github.com/users/AB-D/events{/privacy}","received_events_url":"https://api.github.com/users/AB-D/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AB-D/lesson-four","description":"","fork":true,"url":"https://api.github.com/repos/AB-D/lesson-four","forks_url":"https://api.github.com/repos/AB-D/lesson-four/forks","keys_url":"https://api.github.com/repos/AB-D/lesson-four/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AB-D/lesson-four/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AB-D/lesson-four/teams","hooks_url":"https://api.github.com/repos/AB-D/lesson-four/hooks","issue_events_url":"https://api.github.com/repos/AB-D/lesson-four/issues/events{/number}","events_url":"https://api.github.com/repos/AB-D/lesson-four/events","assignees_url":"https://api.github.com/repos/AB-D/lesson-four/assignees{/user}","branches_url":"https://api.github.com/repos/AB-D/lesson-four/branches{/branch}","tags_url":"https://api.github.com/repos/AB-D/lesson-four/tags","blobs_url":"https://api.github.com/repos/AB-D/lesson-four/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AB-D/lesson-four/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AB-D/lesson-four/git/refs{/sha}","trees_url":"https://api.github.com/repos/AB-D/lesson-four/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AB-D/lesson-four/statuses/{sha}","languages_url":"https://api.github.com/repos/AB-D/lesson-four/languages","stargazers_url":"https://api.github.com/repos/AB-D/lesson-four/stargazers","contributors_url":"https://api.github.com/repos/AB-D/lesson-four/contributors","subscribers_url":"https://api.github.com/repos/AB-D/lesson-four/subscribers","subscription_url":"https://api.github.com/repos/AB-D/lesson-four/subscription","commits_url":"https://api.github.com/repos/AB-D/lesson-four/commits{/sha}","git_commits_url":"https://api.github.com/repos/AB-D/lesson-four/git/commits{/sha}","comments_url":"https://api.github.com/repos/AB-D/lesson-four/comments{/number}","issue_comment_url":"https://api.github.com/repos/AB-D/lesson-four/issues/comments{/number}","contents_url":"https://api.github.com/repos/AB-D/lesson-four/contents/{+path}","compare_url":"https://api.github.com/repos/AB-D/lesson-four/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AB-D/lesson-four/merges","archive_url":"https://api.github.com/repos/AB-D/lesson-four/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AB-D/lesson-four/downloads","issues_url":"https://api.github.com/repos/AB-D/lesson-four/issues{/number}","pulls_url":"https://api.github.com/repos/AB-D/lesson-four/pulls{/number}","milestones_url":"https://api.github.com/repos/AB-D/lesson-four/milestones{/number}","notifications_url":"https://api.github.com/repos/AB-D/lesson-four/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AB-D/lesson-four/labels{/name}","releases_url":"https://api.github.com/repos/AB-D/lesson-four/releases{/id}","created_at":"2015-08-07T03:36:01Z","updated_at":"2015-08-07T03:36:01Z","pushed_at":"2015-08-11T12:22:09Z","git_url":"git://github.com/AB-D/lesson-four.git","ssh_url":"git@github.com:AB-D/lesson-four.git","clone_url":"https://github.com/AB-D/lesson-four.git","svn_url":"https://github.com/AB-D/lesson-four","homepage":null,"size":108,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MelbDjango:master","ref":"master","sha":"a73dff411b352b7a4cc9d7f426435fcdac21f518","user":{"login":"MelbDjango","id":5742364,"avatar_url":"https://avatars.githubusercontent.com/u/5742364?v=3","gravatar_id":"","url":"https://api.github.com/users/MelbDjango","html_url":"https://github.com/MelbDjango","followers_url":"https://api.github.com/users/MelbDjango/followers","following_url":"https://api.github.com/users/MelbDjango/following{/other_user}","gists_url":"https://api.github.com/users/MelbDjango/gists{/gist_id}","starred_url":"https://api.github.com/users/MelbDjango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelbDjango/subscriptions","organizations_url":"https://api.github.com/users/MelbDjango/orgs","repos_url":"https://api.github.com/users/MelbDjango/repos","events_url":"https://api.github.com/users/MelbDjango/events{/privacy}","received_events_url":"https://api.github.com/users/MelbDjango/received_events","type":"Organization","site_admin":false},"repo":{"id":40283002,"name":"lesson-four","full_name":"MelbDjango/lesson-four","owner":{"login":"MelbDjango","id":5742364,"avatar_url":"https://avatars.githubusercontent.com/u/5742364?v=3","gravatar_id":"","url":"https://api.github.com/users/MelbDjango","html_url":"https://github.com/MelbDjango","followers_url":"https://api.github.com/users/MelbDjango/followers","following_url":"https://api.github.com/users/MelbDjango/following{/other_user}","gists_url":"https://api.github.com/users/MelbDjango/gists{/gist_id}","starred_url":"https://api.github.com/users/MelbDjango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelbDjango/subscriptions","organizations_url":"https://api.github.com/users/MelbDjango/orgs","repos_url":"https://api.github.com/users/MelbDjango/repos","events_url":"https://api.github.com/users/MelbDjango/events{/privacy}","received_events_url":"https://api.github.com/users/MelbDjango/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MelbDjango/lesson-four","description":"","fork":false,"url":"https://api.github.com/repos/MelbDjango/lesson-four","forks_url":"https://api.github.com/repos/MelbDjango/lesson-four/forks","keys_url":"https://api.github.com/repos/MelbDjango/lesson-four/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MelbDjango/lesson-four/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MelbDjango/lesson-four/teams","hooks_url":"https://api.github.com/repos/MelbDjango/lesson-four/hooks","issue_events_url":"https://api.github.com/repos/MelbDjango/lesson-four/issues/events{/number}","events_url":"https://api.github.com/repos/MelbDjango/lesson-four/events","assignees_url":"https://api.github.com/repos/MelbDjango/lesson-four/assignees{/user}","branches_url":"https://api.github.com/repos/MelbDjango/lesson-four/branches{/branch}","tags_url":"https://api.github.com/repos/MelbDjango/lesson-four/tags","blobs_url":"https://api.github.com/repos/MelbDjango/lesson-four/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MelbDjango/lesson-four/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MelbDjango/lesson-four/git/refs{/sha}","trees_url":"https://api.github.com/repos/MelbDjango/lesson-four/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MelbDjango/lesson-four/statuses/{sha}","languages_url":"https://api.github.com/repos/MelbDjango/lesson-four/languages","stargazers_url":"https://api.github.com/repos/MelbDjango/lesson-four/stargazers","contributors_url":"https://api.github.com/repos/MelbDjango/lesson-four/contributors","subscribers_url":"https://api.github.com/repos/MelbDjango/lesson-four/subscribers","subscription_url":"https://api.github.com/repos/MelbDjango/lesson-four/subscription","commits_url":"https://api.github.com/repos/MelbDjango/lesson-four/commits{/sha}","git_commits_url":"https://api.github.com/repos/MelbDjango/lesson-four/git/commits{/sha}","comments_url":"https://api.github.com/repos/MelbDjango/lesson-four/comments{/number}","issue_comment_url":"https://api.github.com/repos/MelbDjango/lesson-four/issues/comments{/number}","contents_url":"https://api.github.com/repos/MelbDjango/lesson-four/contents/{+path}","compare_url":"https://api.github.com/repos/MelbDjango/lesson-four/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MelbDjango/lesson-four/merges","archive_url":"https://api.github.com/repos/MelbDjango/lesson-four/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MelbDjango/lesson-four/downloads","issues_url":"https://api.github.com/repos/MelbDjango/lesson-four/issues{/number}","pulls_url":"https://api.github.com/repos/MelbDjango/lesson-four/pulls{/number}","milestones_url":"https://api.github.com/repos/MelbDjango/lesson-four/milestones{/number}","notifications_url":"https://api.github.com/repos/MelbDjango/lesson-four/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MelbDjango/lesson-four/labels{/name}","releases_url":"https://api.github.com/repos/MelbDjango/lesson-four/releases{/id}","created_at":"2015-08-06T03:47:35Z","updated_at":"2015-08-07T03:14:16Z","pushed_at":"2015-08-13T01:55:34Z","git_url":"git://github.com/MelbDjango/lesson-four.git","ssh_url":"git@github.com:MelbDjango/lesson-four.git","clone_url":"https://github.com/MelbDjango/lesson-four.git","svn_url":"https://github.com/MelbDjango/lesson-four","homepage":null,"size":523,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":10,"forks":12,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4"},"html":{"href":"https://github.com/MelbDjango/lesson-four/pull/4"},"issue":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/issues/4"},"comments":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/MelbDjango/lesson-four/statuses/c4079b9f52b251eafa3c8cec7e576231c3cfe588"}}}}