{"action":"created","comment":{"url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/comments/48342164","id":48342164,"diff_hunk":"@@ -0,0 +1,32 @@\n+from flask_wtf import Form\n+from wtforms import StringField, DateTimeField, ValidationError\n+from wtforms.ext.sqlalchemy.fields import QuerySelectField\n+from wtforms.validators import DataRequired, optional\n+from models import Specialist, Customer, Service\n+\n+\n+class SearchForm(Form):\n+    query = StringField('query', validators=[DataRequired()])\n+\n+\n+def start_end_validation(form, field):\n+    if field.data > form.end.data:\n+        raise ValidationError('Start of activity must be earlier than end of activity')\n+\n+\n+class AddServiceActivityForm(Form):\n+    specialist = QuerySelectField(\n+        query_factory=Specialist.query.all,\n+        get_pk=lambda a: a.id,\n+        get_label=lambda a: a.name)\n+    customer = QuerySelectField(\n+        query_factory=Customer.query.all,\n+        get_pk=lambda a: a.id,\n+        get_label=lambda a: a.name)\n+    service = QuerySelectField(\n+        query_factory=Service.query.all,\n+        get_pk=lambda a: a.id,\n+        get_label=lambda a: a.title)\n+    description = StringField('Description', validators=[optional()])\n+    start = DateTimeField('Start', format='%Y-%d-%m %H:%M:%S', validators=[optional(), start_end_validation])","path":"main/forms.py","position":31,"original_position":31,"commit_id":"4d0bfad0599d9cd1a8f3052d611e0d5cd2fd2ce0","original_commit_id":"4d0bfad0599d9cd1a8f3052d611e0d5cd2fd2ce0","user":{"login":"AndrewLvov","id":353226,"avatar_url":"https://avatars.githubusercontent.com/u/353226?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewLvov","html_url":"https://github.com/AndrewLvov","followers_url":"https://api.github.com/users/AndrewLvov/followers","following_url":"https://api.github.com/users/AndrewLvov/following{/other_user}","gists_url":"https://api.github.com/users/AndrewLvov/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewLvov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewLvov/subscriptions","organizations_url":"https://api.github.com/users/AndrewLvov/orgs","repos_url":"https://api.github.com/users/AndrewLvov/repos","events_url":"https://api.github.com/users/AndrewLvov/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewLvov/received_events","type":"User","site_admin":false},"body":"[style] please, limit lines to 80 chars","created_at":"2015-12-23T12:46:31Z","updated_at":"2015-12-23T12:46:31Z","html_url":"https://github.com/DevGuysPy/Specialist/pull/1#discussion_r48342164","pull_request_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/comments/48342164"},"html":{"href":"https://github.com/DevGuysPy/Specialist/pull/1#discussion_r48342164"},"pull_request":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1","id":54465931,"html_url":"https://github.com/DevGuysPy/Specialist/pull/1","diff_url":"https://github.com/DevGuysPy/Specialist/pull/1.diff","patch_url":"https://github.com/DevGuysPy/Specialist/pull/1.patch","issue_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/1","number":1,"state":"open","locked":false,"title":"Add service activity","user":{"login":"Gorillaz322","id":12786798,"avatar_url":"https://avatars.githubusercontent.com/u/12786798?v=3","gravatar_id":"","url":"https://api.github.com/users/Gorillaz322","html_url":"https://github.com/Gorillaz322","followers_url":"https://api.github.com/users/Gorillaz322/followers","following_url":"https://api.github.com/users/Gorillaz322/following{/other_user}","gists_url":"https://api.github.com/users/Gorillaz322/gists{/gist_id}","starred_url":"https://api.github.com/users/Gorillaz322/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gorillaz322/subscriptions","organizations_url":"https://api.github.com/users/Gorillaz322/orgs","repos_url":"https://api.github.com/users/Gorillaz322/repos","events_url":"https://api.github.com/users/Gorillaz322/events{/privacy}","received_events_url":"https://api.github.com/users/Gorillaz322/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-23T12:41:35Z","updated_at":"2015-12-23T12:46:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f278445d71cf08fa2c76285ec05c11171f4006e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1/commits","review_comments_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1/comments","review_comment_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/1/comments","statuses_url":"https://api.github.com/repos/DevGuysPy/Specialist/statuses/4d0bfad0599d9cd1a8f3052d611e0d5cd2fd2ce0","head":{"label":"DevGuysPy:add-service-activity","ref":"add-service-activity","sha":"4d0bfad0599d9cd1a8f3052d611e0d5cd2fd2ce0","user":{"login":"DevGuysPy","id":12783740,"avatar_url":"https://avatars.githubusercontent.com/u/12783740?v=3","gravatar_id":"","url":"https://api.github.com/users/DevGuysPy","html_url":"https://github.com/DevGuysPy","followers_url":"https://api.github.com/users/DevGuysPy/followers","following_url":"https://api.github.com/users/DevGuysPy/following{/other_user}","gists_url":"https://api.github.com/users/DevGuysPy/gists{/gist_id}","starred_url":"https://api.github.com/users/DevGuysPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevGuysPy/subscriptions","organizations_url":"https://api.github.com/users/DevGuysPy/orgs","repos_url":"https://api.github.com/users/DevGuysPy/repos","events_url":"https://api.github.com/users/DevGuysPy/events{/privacy}","received_events_url":"https://api.github.com/users/DevGuysPy/received_events","type":"Organization","site_admin":false},"repo":{"id":48330416,"name":"Specialist","full_name":"DevGuysPy/Specialist","owner":{"login":"DevGuysPy","id":12783740,"avatar_url":"https://avatars.githubusercontent.com/u/12783740?v=3","gravatar_id":"","url":"https://api.github.com/users/DevGuysPy","html_url":"https://github.com/DevGuysPy","followers_url":"https://api.github.com/users/DevGuysPy/followers","following_url":"https://api.github.com/users/DevGuysPy/following{/other_user}","gists_url":"https://api.github.com/users/DevGuysPy/gists{/gist_id}","starred_url":"https://api.github.com/users/DevGuysPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevGuysPy/subscriptions","organizations_url":"https://api.github.com/users/DevGuysPy/orgs","repos_url":"https://api.github.com/users/DevGuysPy/repos","events_url":"https://api.github.com/users/DevGuysPy/events{/privacy}","received_events_url":"https://api.github.com/users/DevGuysPy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DevGuysPy/Specialist","description":"","fork":false,"url":"https://api.github.com/repos/DevGuysPy/Specialist","forks_url":"https://api.github.com/repos/DevGuysPy/Specialist/forks","keys_url":"https://api.github.com/repos/DevGuysPy/Specialist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DevGuysPy/Specialist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DevGuysPy/Specialist/teams","hooks_url":"https://api.github.com/repos/DevGuysPy/Specialist/hooks","issue_events_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/events{/number}","events_url":"https://api.github.com/repos/DevGuysPy/Specialist/events","assignees_url":"https://api.github.com/repos/DevGuysPy/Specialist/assignees{/user}","branches_url":"https://api.github.com/repos/DevGuysPy/Specialist/branches{/branch}","tags_url":"https://api.github.com/repos/DevGuysPy/Specialist/tags","blobs_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/refs{/sha}","trees_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DevGuysPy/Specialist/statuses/{sha}","languages_url":"https://api.github.com/repos/DevGuysPy/Specialist/languages","stargazers_url":"https://api.github.com/repos/DevGuysPy/Specialist/stargazers","contributors_url":"https://api.github.com/repos/DevGuysPy/Specialist/contributors","subscribers_url":"https://api.github.com/repos/DevGuysPy/Specialist/subscribers","subscription_url":"https://api.github.com/repos/DevGuysPy/Specialist/subscription","commits_url":"https://api.github.com/repos/DevGuysPy/Specialist/commits{/sha}","git_commits_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/commits{/sha}","comments_url":"https://api.github.com/repos/DevGuysPy/Specialist/comments{/number}","issue_comment_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/comments{/number}","contents_url":"https://api.github.com/repos/DevGuysPy/Specialist/contents/{+path}","compare_url":"https://api.github.com/repos/DevGuysPy/Specialist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DevGuysPy/Specialist/merges","archive_url":"https://api.github.com/repos/DevGuysPy/Specialist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DevGuysPy/Specialist/downloads","issues_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues{/number}","pulls_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls{/number}","milestones_url":"https://api.github.com/repos/DevGuysPy/Specialist/milestones{/number}","notifications_url":"https://api.github.com/repos/DevGuysPy/Specialist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DevGuysPy/Specialist/labels{/name}","releases_url":"https://api.github.com/repos/DevGuysPy/Specialist/releases{/id}","created_at":"2015-12-20T17:22:54Z","updated_at":"2015-12-20T17:24:12Z","pushed_at":"2015-12-23T12:41:36Z","git_url":"git://github.com/DevGuysPy/Specialist.git","ssh_url":"git@github.com:DevGuysPy/Specialist.git","clone_url":"https://github.com/DevGuysPy/Specialist.git","svn_url":"https://github.com/DevGuysPy/Specialist","homepage":null,"size":333,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DevGuysPy:master","ref":"master","sha":"a6196ba78be3096aa72478114c9c8ade9e089a07","user":{"login":"DevGuysPy","id":12783740,"avatar_url":"https://avatars.githubusercontent.com/u/12783740?v=3","gravatar_id":"","url":"https://api.github.com/users/DevGuysPy","html_url":"https://github.com/DevGuysPy","followers_url":"https://api.github.com/users/DevGuysPy/followers","following_url":"https://api.github.com/users/DevGuysPy/following{/other_user}","gists_url":"https://api.github.com/users/DevGuysPy/gists{/gist_id}","starred_url":"https://api.github.com/users/DevGuysPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevGuysPy/subscriptions","organizations_url":"https://api.github.com/users/DevGuysPy/orgs","repos_url":"https://api.github.com/users/DevGuysPy/repos","events_url":"https://api.github.com/users/DevGuysPy/events{/privacy}","received_events_url":"https://api.github.com/users/DevGuysPy/received_events","type":"Organization","site_admin":false},"repo":{"id":48330416,"name":"Specialist","full_name":"DevGuysPy/Specialist","owner":{"login":"DevGuysPy","id":12783740,"avatar_url":"https://avatars.githubusercontent.com/u/12783740?v=3","gravatar_id":"","url":"https://api.github.com/users/DevGuysPy","html_url":"https://github.com/DevGuysPy","followers_url":"https://api.github.com/users/DevGuysPy/followers","following_url":"https://api.github.com/users/DevGuysPy/following{/other_user}","gists_url":"https://api.github.com/users/DevGuysPy/gists{/gist_id}","starred_url":"https://api.github.com/users/DevGuysPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevGuysPy/subscriptions","organizations_url":"https://api.github.com/users/DevGuysPy/orgs","repos_url":"https://api.github.com/users/DevGuysPy/repos","events_url":"https://api.github.com/users/DevGuysPy/events{/privacy}","received_events_url":"https://api.github.com/users/DevGuysPy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DevGuysPy/Specialist","description":"","fork":false,"url":"https://api.github.com/repos/DevGuysPy/Specialist","forks_url":"https://api.github.com/repos/DevGuysPy/Specialist/forks","keys_url":"https://api.github.com/repos/DevGuysPy/Specialist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DevGuysPy/Specialist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DevGuysPy/Specialist/teams","hooks_url":"https://api.github.com/repos/DevGuysPy/Specialist/hooks","issue_events_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/events{/number}","events_url":"https://api.github.com/repos/DevGuysPy/Specialist/events","assignees_url":"https://api.github.com/repos/DevGuysPy/Specialist/assignees{/user}","branches_url":"https://api.github.com/repos/DevGuysPy/Specialist/branches{/branch}","tags_url":"https://api.github.com/repos/DevGuysPy/Specialist/tags","blobs_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/refs{/sha}","trees_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DevGuysPy/Specialist/statuses/{sha}","languages_url":"https://api.github.com/repos/DevGuysPy/Specialist/languages","stargazers_url":"https://api.github.com/repos/DevGuysPy/Specialist/stargazers","contributors_url":"https://api.github.com/repos/DevGuysPy/Specialist/contributors","subscribers_url":"https://api.github.com/repos/DevGuysPy/Specialist/subscribers","subscription_url":"https://api.github.com/repos/DevGuysPy/Specialist/subscription","commits_url":"https://api.github.com/repos/DevGuysPy/Specialist/commits{/sha}","git_commits_url":"https://api.github.com/repos/DevGuysPy/Specialist/git/commits{/sha}","comments_url":"https://api.github.com/repos/DevGuysPy/Specialist/comments{/number}","issue_comment_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues/comments{/number}","contents_url":"https://api.github.com/repos/DevGuysPy/Specialist/contents/{+path}","compare_url":"https://api.github.com/repos/DevGuysPy/Specialist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DevGuysPy/Specialist/merges","archive_url":"https://api.github.com/repos/DevGuysPy/Specialist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DevGuysPy/Specialist/downloads","issues_url":"https://api.github.com/repos/DevGuysPy/Specialist/issues{/number}","pulls_url":"https://api.github.com/repos/DevGuysPy/Specialist/pulls{/number}","milestones_url":"https://api.github.com/repos/DevGuysPy/Specialist/milestones{/number}","notifications_url":"https://api.github.com/repos/DevGuysPy/Specialist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DevGuysPy/Specialist/labels{/name}","releases_url":"https://api.github.com/repos/DevGuysPy/Specialist/releases{/id}","created_at":"2015-12-20T17:22:54Z","updated_at":"2015-12-20T17:24:12Z","pushed_at":"2015-12-23T12:41:36Z","git_url":"git://github.com/DevGuysPy/Specialist.git","ssh_url":"git@github.com:DevGuysPy/Specialist.git","clone_url":"https://github.com/DevGuysPy/Specialist.git","svn_url":"https://github.com/DevGuysPy/Specialist","homepage":null,"size":333,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1"},"html":{"href":"https://github.com/DevGuysPy/Specialist/pull/1"},"issue":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/issues/1"},"comments":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/DevGuysPy/Specialist/statuses/4d0bfad0599d9cd1a8f3052d611e0d5cd2fd2ce0"}}}}