{"action":"closed","number":364,"pull_request":{"url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364","id":53529004,"html_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/364","diff_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/364.diff","patch_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/364.patch","issue_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/364","number":364,"state":"closed","locked":false,"title":"Fix db.session so that events work","user":{"login":"davidism","id":1242887,"avatar_url":"https://avatars.githubusercontent.com/u/1242887?v=3","gravatar_id":"","url":"https://api.github.com/users/davidism","html_url":"https://github.com/davidism","followers_url":"https://api.github.com/users/davidism/followers","following_url":"https://api.github.com/users/davidism/following{/other_user}","gists_url":"https://api.github.com/users/davidism/gists{/gist_id}","starred_url":"https://api.github.com/users/davidism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidism/subscriptions","organizations_url":"https://api.github.com/users/davidism/orgs","repos_url":"https://api.github.com/users/davidism/repos","events_url":"https://api.github.com/users/davidism/events{/privacy}","received_events_url":"https://api.github.com/users/davidism/received_events","type":"User","site_admin":false},"body":"`create_scoped_session` was using `partial` as the factory to `scoped_session`.  SQLAlchemy doesn't recognize this when listening to events, so it raises an exception.  Creating a `sessionmaker` in `create_session` fixes this.\r\n\r\n    sqlalchemy.exc.ArgumentError: Session event listen on a scoped_session requires that its creation callable is associated with the Session class.\r\n\r\nAlso changed `create_scoped_session` to include the default `scopefunc` and `query_cls`, since it would be pretty much pointless to manually use this function without those provided.\r\n\r\n#182, #64, #147, #148","created_at":"2015-12-14T06:31:51Z","updated_at":"2015-12-14T06:33:36Z","closed_at":"2015-12-14T06:33:36Z","merged_at":"2015-12-14T06:33:35Z","merge_commit_sha":"c21ceb3aed6ba8737fc75e412ce78ae9a366c354","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364/commits","review_comments_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364/comments","review_comment_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/364/comments","statuses_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/3fec7535922e687e0518bdbfcd24b6389ab5c3af","head":{"label":"mitsuhiko:session_factory","ref":"session_factory","sha":"3fec7535922e687e0518bdbfcd24b6389ab5c3af","user":{"login":"mitsuhiko","id":7396,"avatar_url":"https://avatars.githubusercontent.com/u/7396?v=3","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"repo":{"id":697361,"name":"flask-sqlalchemy","full_name":"mitsuhiko/flask-sqlalchemy","owner":{"login":"mitsuhiko","id":7396,"avatar_url":"https://avatars.githubusercontent.com/u/7396?v=3","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitsuhiko/flask-sqlalchemy","description":"Adds SQLAlchemy support to Flask","fork":false,"url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy","forks_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/forks","keys_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/teams","hooks_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/hooks","issue_events_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/events{/number}","events_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/events","assignees_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/assignees{/user}","branches_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/branches{/branch}","tags_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/tags","blobs_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/{sha}","languages_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/languages","stargazers_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/stargazers","contributors_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/contributors","subscribers_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/subscribers","subscription_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/subscription","commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/contents/{+path}","compare_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/merges","archive_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/downloads","issues_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues{/number}","pulls_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls{/number}","milestones_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/milestones{/number}","notifications_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/labels{/name}","releases_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/releases{/id}","created_at":"2010-06-01T15:01:50Z","updated_at":"2015-12-13T20:33:20Z","pushed_at":"2015-12-14T06:33:35Z","git_url":"git://github.com/mitsuhiko/flask-sqlalchemy.git","ssh_url":"git@github.com:mitsuhiko/flask-sqlalchemy.git","clone_url":"https://github.com/mitsuhiko/flask-sqlalchemy.git","svn_url":"https://github.com/mitsuhiko/flask-sqlalchemy","homepage":"http://flask-sqlalchemy.pocoo.org/","size":844,"stargazers_count":1074,"watchers_count":1074,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":326,"mirror_url":null,"open_issues_count":43,"forks":326,"open_issues":43,"watchers":1074,"default_branch":"master"}},"base":{"label":"mitsuhiko:master","ref":"master","sha":"c1a952f2af3e496bbd39674acaf7cbba07619761","user":{"login":"mitsuhiko","id":7396,"avatar_url":"https://avatars.githubusercontent.com/u/7396?v=3","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"repo":{"id":697361,"name":"flask-sqlalchemy","full_name":"mitsuhiko/flask-sqlalchemy","owner":{"login":"mitsuhiko","id":7396,"avatar_url":"https://avatars.githubusercontent.com/u/7396?v=3","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitsuhiko/flask-sqlalchemy","description":"Adds SQLAlchemy support to Flask","fork":false,"url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy","forks_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/forks","keys_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/teams","hooks_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/hooks","issue_events_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/events{/number}","events_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/events","assignees_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/assignees{/user}","branches_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/branches{/branch}","tags_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/tags","blobs_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/{sha}","languages_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/languages","stargazers_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/stargazers","contributors_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/contributors","subscribers_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/subscribers","subscription_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/subscription","commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/contents/{+path}","compare_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/merges","archive_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/downloads","issues_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues{/number}","pulls_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls{/number}","milestones_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/milestones{/number}","notifications_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/labels{/name}","releases_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/releases{/id}","created_at":"2010-06-01T15:01:50Z","updated_at":"2015-12-13T20:33:20Z","pushed_at":"2015-12-14T06:33:35Z","git_url":"git://github.com/mitsuhiko/flask-sqlalchemy.git","ssh_url":"git@github.com:mitsuhiko/flask-sqlalchemy.git","clone_url":"https://github.com/mitsuhiko/flask-sqlalchemy.git","svn_url":"https://github.com/mitsuhiko/flask-sqlalchemy","homepage":"http://flask-sqlalchemy.pocoo.org/","size":844,"stargazers_count":1074,"watchers_count":1074,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":326,"mirror_url":null,"open_issues_count":43,"forks":326,"open_issues":43,"watchers":1074,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364"},"html":{"href":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/364"},"issue":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/364"},"comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364/comments"},"review_comment":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/364/commits"},"statuses":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/3fec7535922e687e0518bdbfcd24b6389ab5c3af"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"davidism","id":1242887,"avatar_url":"https://avatars.githubusercontent.com/u/1242887?v=3","gravatar_id":"","url":"https://api.github.com/users/davidism","html_url":"https://github.com/davidism","followers_url":"https://api.github.com/users/davidism/followers","following_url":"https://api.github.com/users/davidism/following{/other_user}","gists_url":"https://api.github.com/users/davidism/gists{/gist_id}","starred_url":"https://api.github.com/users/davidism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidism/subscriptions","organizations_url":"https://api.github.com/users/davidism/orgs","repos_url":"https://api.github.com/users/davidism/repos","events_url":"https://api.github.com/users/davidism/events{/privacy}","received_events_url":"https://api.github.com/users/davidism/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":38,"deletions":20,"changed_files":2}}