{"action":"created","comment":{"url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/comments/190871448","pull_request_review_id":123343380,"id":190871448,"diff_hunk":"@@ -22,7 +25,48 @@ def create_app(config=DevConfig):\n     mail.init_app(app)\n \n     db.init_app(app)\n+\n+    from models import (Book, Author)\n     with app.app_context():\n         db.create_all()\n \n+        books_properties = get_book_data()\n+\n+        for elem in books_properties:\n+            title = elem['title']\n+            asset = elem['asset']\n+        #   title = book['title']\n+        #    book = Book(title = title)\n+        #   book.title = title\n+            authors = elem['authors']\n+            book_authors = []\n+            if type(authors) is tuple:\n+                f_name = str(authors[0])\n+                l_name = str(authors[1])\n+                author = Author(first_name=f_name, last_name=l_name)\n+                book_authors.append(author)\n+                #print(f_name, l_name)\n+                db.session.add(author)\n+            elif type(authors) is list:\n+                for i in authors:\n+                    f_name = str(i[0])\n+                    l_name = str(i[1])\n+                    author = Author(first_name = f_name, last_name = l_name)","path":"app.py","position":44,"original_position":44,"commit_id":"3483b838d7c3adc2084572b4e583cb2ea81b4169","original_commit_id":"3483b838d7c3adc2084572b4e583cb2ea81b4169","user":{"login":"stickler-ci","id":16011037,"avatar_url":"https://avatars3.githubusercontent.com/u/16011037?v=4","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"E251 unexpected spaces around keyword / parameter equals","created_at":"2018-05-25T11:57:45Z","updated_at":"2018-05-25T11:57:47Z","html_url":"https://github.com/InkubatorTieto/melvil/pull/22#discussion_r190871448","pull_request_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/comments/190871448"},"html":{"href":"https://github.com/InkubatorTieto/melvil/pull/22#discussion_r190871448"},"pull_request":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22","id":190566167,"html_url":"https://github.com/InkubatorTieto/melvil/pull/22","diff_url":"https://github.com/InkubatorTieto/melvil/pull/22.diff","patch_url":"https://github.com/InkubatorTieto/melvil/pull/22.patch","issue_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/22","number":22,"state":"open","locked":false,"title":"Feature/loadiong books into db","user":{"login":"mariawedler","id":39115329,"avatar_url":"https://avatars3.githubusercontent.com/u/39115329?v=4","gravatar_id":"","url":"https://api.github.com/users/mariawedler","html_url":"https://github.com/mariawedler","followers_url":"https://api.github.com/users/mariawedler/followers","following_url":"https://api.github.com/users/mariawedler/following{/other_user}","gists_url":"https://api.github.com/users/mariawedler/gists{/gist_id}","starred_url":"https://api.github.com/users/mariawedler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariawedler/subscriptions","organizations_url":"https://api.github.com/users/mariawedler/orgs","repos_url":"https://api.github.com/users/mariawedler/repos","events_url":"https://api.github.com/users/mariawedler/events{/privacy}","received_events_url":"https://api.github.com/users/mariawedler/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-25T11:57:36Z","updated_at":"2018-05-25T11:57:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8246eef7e1e06aa3ef3eb7f6da2fe2b98a4cde1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22/commits","review_comments_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22/comments","review_comment_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/22/comments","statuses_url":"https://api.github.com/repos/InkubatorTieto/melvil/statuses/3483b838d7c3adc2084572b4e583cb2ea81b4169","head":{"label":"InkubatorTieto:feature/loadiong_books_into_DB","ref":"feature/loadiong_books_into_DB","sha":"3483b838d7c3adc2084572b4e583cb2ea81b4169","user":{"login":"InkubatorTieto","id":38905594,"avatar_url":"https://avatars0.githubusercontent.com/u/38905594?v=4","gravatar_id":"","url":"https://api.github.com/users/InkubatorTieto","html_url":"https://github.com/InkubatorTieto","followers_url":"https://api.github.com/users/InkubatorTieto/followers","following_url":"https://api.github.com/users/InkubatorTieto/following{/other_user}","gists_url":"https://api.github.com/users/InkubatorTieto/gists{/gist_id}","starred_url":"https://api.github.com/users/InkubatorTieto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InkubatorTieto/subscriptions","organizations_url":"https://api.github.com/users/InkubatorTieto/orgs","repos_url":"https://api.github.com/users/InkubatorTieto/repos","events_url":"https://api.github.com/users/InkubatorTieto/events{/privacy}","received_events_url":"https://api.github.com/users/InkubatorTieto/received_events","type":"Organization","site_admin":false},"repo":{"id":131816331,"name":"melvil","full_name":"InkubatorTieto/melvil","owner":{"login":"InkubatorTieto","id":38905594,"avatar_url":"https://avatars0.githubusercontent.com/u/38905594?v=4","gravatar_id":"","url":"https://api.github.com/users/InkubatorTieto","html_url":"https://github.com/InkubatorTieto","followers_url":"https://api.github.com/users/InkubatorTieto/followers","following_url":"https://api.github.com/users/InkubatorTieto/following{/other_user}","gists_url":"https://api.github.com/users/InkubatorTieto/gists{/gist_id}","starred_url":"https://api.github.com/users/InkubatorTieto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InkubatorTieto/subscriptions","organizations_url":"https://api.github.com/users/InkubatorTieto/orgs","repos_url":"https://api.github.com/users/InkubatorTieto/repos","events_url":"https://api.github.com/users/InkubatorTieto/events{/privacy}","received_events_url":"https://api.github.com/users/InkubatorTieto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InkubatorTieto/melvil","description":null,"fork":false,"url":"https://api.github.com/repos/InkubatorTieto/melvil","forks_url":"https://api.github.com/repos/InkubatorTieto/melvil/forks","keys_url":"https://api.github.com/repos/InkubatorTieto/melvil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InkubatorTieto/melvil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InkubatorTieto/melvil/teams","hooks_url":"https://api.github.com/repos/InkubatorTieto/melvil/hooks","issue_events_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/events{/number}","events_url":"https://api.github.com/repos/InkubatorTieto/melvil/events","assignees_url":"https://api.github.com/repos/InkubatorTieto/melvil/assignees{/user}","branches_url":"https://api.github.com/repos/InkubatorTieto/melvil/branches{/branch}","tags_url":"https://api.github.com/repos/InkubatorTieto/melvil/tags","blobs_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/refs{/sha}","trees_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InkubatorTieto/melvil/statuses/{sha}","languages_url":"https://api.github.com/repos/InkubatorTieto/melvil/languages","stargazers_url":"https://api.github.com/repos/InkubatorTieto/melvil/stargazers","contributors_url":"https://api.github.com/repos/InkubatorTieto/melvil/contributors","subscribers_url":"https://api.github.com/repos/InkubatorTieto/melvil/subscribers","subscription_url":"https://api.github.com/repos/InkubatorTieto/melvil/subscription","commits_url":"https://api.github.com/repos/InkubatorTieto/melvil/commits{/sha}","git_commits_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/commits{/sha}","comments_url":"https://api.github.com/repos/InkubatorTieto/melvil/comments{/number}","issue_comment_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/comments{/number}","contents_url":"https://api.github.com/repos/InkubatorTieto/melvil/contents/{+path}","compare_url":"https://api.github.com/repos/InkubatorTieto/melvil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InkubatorTieto/melvil/merges","archive_url":"https://api.github.com/repos/InkubatorTieto/melvil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InkubatorTieto/melvil/downloads","issues_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues{/number}","pulls_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls{/number}","milestones_url":"https://api.github.com/repos/InkubatorTieto/melvil/milestones{/number}","notifications_url":"https://api.github.com/repos/InkubatorTieto/melvil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InkubatorTieto/melvil/labels{/name}","releases_url":"https://api.github.com/repos/InkubatorTieto/melvil/releases{/id}","deployments_url":"https://api.github.com/repos/InkubatorTieto/melvil/deployments","created_at":"2018-05-02T07:46:34Z","updated_at":"2018-05-16T15:07:17Z","pushed_at":"2018-05-25T11:57:36Z","git_url":"git://github.com/InkubatorTieto/melvil.git","ssh_url":"git@github.com:InkubatorTieto/melvil.git","clone_url":"https://github.com/InkubatorTieto/melvil.git","svn_url":"https://github.com/InkubatorTieto/melvil","homepage":null,"size":14171,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"InkubatorTieto:beta-release","ref":"beta-release","sha":"9c53c37d361259af82f16595442951abaf37440d","user":{"login":"InkubatorTieto","id":38905594,"avatar_url":"https://avatars0.githubusercontent.com/u/38905594?v=4","gravatar_id":"","url":"https://api.github.com/users/InkubatorTieto","html_url":"https://github.com/InkubatorTieto","followers_url":"https://api.github.com/users/InkubatorTieto/followers","following_url":"https://api.github.com/users/InkubatorTieto/following{/other_user}","gists_url":"https://api.github.com/users/InkubatorTieto/gists{/gist_id}","starred_url":"https://api.github.com/users/InkubatorTieto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InkubatorTieto/subscriptions","organizations_url":"https://api.github.com/users/InkubatorTieto/orgs","repos_url":"https://api.github.com/users/InkubatorTieto/repos","events_url":"https://api.github.com/users/InkubatorTieto/events{/privacy}","received_events_url":"https://api.github.com/users/InkubatorTieto/received_events","type":"Organization","site_admin":false},"repo":{"id":131816331,"name":"melvil","full_name":"InkubatorTieto/melvil","owner":{"login":"InkubatorTieto","id":38905594,"avatar_url":"https://avatars0.githubusercontent.com/u/38905594?v=4","gravatar_id":"","url":"https://api.github.com/users/InkubatorTieto","html_url":"https://github.com/InkubatorTieto","followers_url":"https://api.github.com/users/InkubatorTieto/followers","following_url":"https://api.github.com/users/InkubatorTieto/following{/other_user}","gists_url":"https://api.github.com/users/InkubatorTieto/gists{/gist_id}","starred_url":"https://api.github.com/users/InkubatorTieto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InkubatorTieto/subscriptions","organizations_url":"https://api.github.com/users/InkubatorTieto/orgs","repos_url":"https://api.github.com/users/InkubatorTieto/repos","events_url":"https://api.github.com/users/InkubatorTieto/events{/privacy}","received_events_url":"https://api.github.com/users/InkubatorTieto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InkubatorTieto/melvil","description":null,"fork":false,"url":"https://api.github.com/repos/InkubatorTieto/melvil","forks_url":"https://api.github.com/repos/InkubatorTieto/melvil/forks","keys_url":"https://api.github.com/repos/InkubatorTieto/melvil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InkubatorTieto/melvil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InkubatorTieto/melvil/teams","hooks_url":"https://api.github.com/repos/InkubatorTieto/melvil/hooks","issue_events_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/events{/number}","events_url":"https://api.github.com/repos/InkubatorTieto/melvil/events","assignees_url":"https://api.github.com/repos/InkubatorTieto/melvil/assignees{/user}","branches_url":"https://api.github.com/repos/InkubatorTieto/melvil/branches{/branch}","tags_url":"https://api.github.com/repos/InkubatorTieto/melvil/tags","blobs_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/refs{/sha}","trees_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InkubatorTieto/melvil/statuses/{sha}","languages_url":"https://api.github.com/repos/InkubatorTieto/melvil/languages","stargazers_url":"https://api.github.com/repos/InkubatorTieto/melvil/stargazers","contributors_url":"https://api.github.com/repos/InkubatorTieto/melvil/contributors","subscribers_url":"https://api.github.com/repos/InkubatorTieto/melvil/subscribers","subscription_url":"https://api.github.com/repos/InkubatorTieto/melvil/subscription","commits_url":"https://api.github.com/repos/InkubatorTieto/melvil/commits{/sha}","git_commits_url":"https://api.github.com/repos/InkubatorTieto/melvil/git/commits{/sha}","comments_url":"https://api.github.com/repos/InkubatorTieto/melvil/comments{/number}","issue_comment_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues/comments{/number}","contents_url":"https://api.github.com/repos/InkubatorTieto/melvil/contents/{+path}","compare_url":"https://api.github.com/repos/InkubatorTieto/melvil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InkubatorTieto/melvil/merges","archive_url":"https://api.github.com/repos/InkubatorTieto/melvil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InkubatorTieto/melvil/downloads","issues_url":"https://api.github.com/repos/InkubatorTieto/melvil/issues{/number}","pulls_url":"https://api.github.com/repos/InkubatorTieto/melvil/pulls{/number}","milestones_url":"https://api.github.com/repos/InkubatorTieto/melvil/milestones{/number}","notifications_url":"https://api.github.com/repos/InkubatorTieto/melvil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InkubatorTieto/melvil/labels{/name}","releases_url":"https://api.github.com/repos/InkubatorTieto/melvil/releases{/id}","deployments_url":"https://api.github.com/repos/InkubatorTieto/melvil/deployments","created_at":"2018-05-02T07:46:34Z","updated_at":"2018-05-16T15:07:17Z","pushed_at":"2018-05-25T11:57:36Z","git_url":"git://github.com/InkubatorTieto/melvil.git","ssh_url":"git@github.com:InkubatorTieto/melvil.git","clone_url":"https://github.com/InkubatorTieto/melvil.git","svn_url":"https://github.com/InkubatorTieto/melvil","homepage":null,"size":14171,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22"},"html":{"href":"https://github.com/InkubatorTieto/melvil/pull/22"},"issue":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/issues/22"},"comments":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/InkubatorTieto/melvil/statuses/3483b838d7c3adc2084572b4e583cb2ea81b4169"}},"author_association":"NONE"}}
{"actor":{"display_login":"stickler-ci"}}