{"action":"opened","number":358,"pull_request":{"url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/358","id":52718583,"html_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/358","diff_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/358.diff","patch_url":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/358.patch","issue_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/358","number":358,"state":"open","locked":false,"title":"Add support for nested sessions (SAVEPOINTs) in modifications tracking","user":{"login":"barakalon","id":12398927,"avatar_url":"https://avatars.githubusercontent.com/u/12398927?v=3","gravatar_id":"","url":"https://api.github.com/users/barakalon","html_url":"https://github.com/barakalon","followers_url":"https://api.github.com/users/barakalon/followers","following_url":"https://api.github.com/users/barakalon/following{/other_user}","gists_url":"https://api.github.com/users/barakalon/gists{/gist_id}","starred_url":"https://api.github.com/users/barakalon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barakalon/subscriptions","organizations_url":"https://api.github.com/users/barakalon/orgs","repos_url":"https://api.github.com/users/barakalon/repos","events_url":"https://api.github.com/users/barakalon/events{/privacy}","received_events_url":"https://api.github.com/users/barakalon/received_events","type":"User","site_admin":false},"body":"I love the signals for tracking modifications to models. However, they don't yet support [nested sessions](http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html#using-savepoint).\r\n\r\nHere is a proposal for adding support for this. It uses a stack of dictionaries instead of just a dictionary for tracking models that have been inserted/updated/deleted. When a nested session begins, a new dictionary is pushed to the stack. If that nested session is rolled back, the changes that happened during that session are removed. If that nested session is committed, the changes are merged into the next item.\r\n\r\nAnywho, let me know what you think! This is my first attempt at a contribution to flask-sqlalchemy, so take it easy on me :grin:","created_at":"2015-12-04T20:40:39Z","updated_at":"2015-12-04T20:40:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/358/commits","review_comments_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/358/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/358/comments","statuses_url":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/5a99038cac1e277e810f8134687a4a55757a55f0","head":{"label":"barakalon:track-changes-to-support-nesting","ref":"track-changes-to-support-nesting","sha":"5a99038cac1e277e810f8134687a4a55757a55f0","user":{"login":"barakalon","id":12398927,"avatar_url":"https://avatars.githubusercontent.com/u/12398927?v=3","gravatar_id":"","url":"https://api.github.com/users/barakalon","html_url":"https://github.com/barakalon","followers_url":"https://api.github.com/users/barakalon/followers","following_url":"https://api.github.com/users/barakalon/following{/other_user}","gists_url":"https://api.github.com/users/barakalon/gists{/gist_id}","starred_url":"https://api.github.com/users/barakalon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barakalon/subscriptions","organizations_url":"https://api.github.com/users/barakalon/orgs","repos_url":"https://api.github.com/users/barakalon/repos","events_url":"https://api.github.com/users/barakalon/events{/privacy}","received_events_url":"https://api.github.com/users/barakalon/received_events","type":"User","site_admin":false},"repo":{"id":47426968,"name":"flask-sqlalchemy","full_name":"barakalon/flask-sqlalchemy","owner":{"login":"barakalon","id":12398927,"avatar_url":"https://avatars.githubusercontent.com/u/12398927?v=3","gravatar_id":"","url":"https://api.github.com/users/barakalon","html_url":"https://github.com/barakalon","followers_url":"https://api.github.com/users/barakalon/followers","following_url":"https://api.github.com/users/barakalon/following{/other_user}","gists_url":"https://api.github.com/users/barakalon/gists{/gist_id}","starred_url":"https://api.github.com/users/barakalon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barakalon/subscriptions","organizations_url":"https://api.github.com/users/barakalon/orgs","repos_url":"https://api.github.com/users/barakalon/repos","events_url":"https://api.github.com/users/barakalon/events{/privacy}","received_events_url":"https://api.github.com/users/barakalon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/barakalon/flask-sqlalchemy","description":"Adds SQLAlchemy support to Flask","fork":true,"url":"https://api.github.com/repos/barakalon/flask-sqlalchemy","forks_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/forks","keys_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/teams","hooks_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/hooks","issue_events_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/issues/events{/number}","events_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/events","assignees_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/assignees{/user}","branches_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/branches{/branch}","tags_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/tags","blobs_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/git/refs{/sha}","trees_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/statuses/{sha}","languages_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/languages","stargazers_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/stargazers","contributors_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/contributors","subscribers_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/subscribers","subscription_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/subscription","commits_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/commits{/sha}","git_commits_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/git/commits{/sha}","comments_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/comments{/number}","issue_comment_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/issues/comments{/number}","contents_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/contents/{+path}","compare_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/merges","archive_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/downloads","issues_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/issues{/number}","pulls_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/pulls{/number}","milestones_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/milestones{/number}","notifications_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/labels{/name}","releases_url":"https://api.github.com/repos/barakalon/flask-sqlalchemy/releases{/id}","created_at":"2015-12-04T20:22:56Z","updated_at":"2015-12-04T20:22:57Z","pushed_at":"2015-12-04T20:31:36Z","git_url":"git://github.com/barakalon/flask-sqlalchemy.git","ssh_url":"git@github.com:barakalon/flask-sqlalchemy.git","clone_url":"https://github.com/barakalon/flask-sqlalchemy.git","svn_url":"https://github.com/barakalon/flask-sqlalchemy","homepage":"http://flask-sqlalchemy.pocoo.org/","size":462,"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":"mitsuhiko:master","ref":"master","sha":"8c89a761b52151c154d16e8f73903f3b6cd6d28a","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-03T15:29:02Z","pushed_at":"2015-12-04T17:42:46Z","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":793,"stargazers_count":1062,"watchers_count":1062,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":321,"mirror_url":null,"open_issues_count":54,"forks":321,"open_issues":54,"watchers":1062,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/358"},"html":{"href":"https://github.com/mitsuhiko/flask-sqlalchemy/pull/358"},"issue":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/358"},"comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/issues/358/comments"},"review_comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/pulls/358/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/358/commits"},"statuses":{"href":"https://api.github.com/repos/mitsuhiko/flask-sqlalchemy/statuses/5a99038cac1e277e810f8134687a4a55757a55f0"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":81,"deletions":16,"changed_files":2}}