GitHub PullRequestReviewCommentEvent at 2014-12-10 20:41:37
Repository: mongothon
Actor: inlinestyle
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/gamechanger/mongothon/pulls/comments/21635266","id":21635266,"diff_hunk":"@@ -23,7 +23,23 @@ def create_model(schema, collection, class_name=None):\n \n     model_class = type(class_name,\n                        (Model,),\n-                       dict(schema=schema, collection=collection))\n+                       dict(schema=schema, _collection_factory=staticmethod(lambda: collection)))\n+\n+    frm = inspect.stack()[1]","path":"mongothon/__init__.py","position":7,"original_position":7,"commit_id":"8dbbf9e7572c8a65f2119273b4114d96d53839df","original_commit_id":"8dbbf9e7572c8a65f2119273b4114d96d53839df","user":{"login":"inlinestyle","id":1098749,"avatar_url":"https://avatars.githubusercontent.com/u/1098749?v=3","gravatar_id":"","url":"https://api.github.com/users/inlinestyle","html_url":"https://github.com/inlinestyle","followers_url":"https://api.github.com/users/inlinestyle/followers","following_url":"https://api.github.com/users/inlinestyle/following{/other_user}","gists_url":"https://api.github.com/users/inlinestyle/gists{/gist_id}","starred_url":"https://api.github.com/users/inlinestyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inlinestyle/subscriptions","organizations_url":"https://api.github.com/users/inlinestyle/orgs","repos_url":"https://api.github.com/users/inlinestyle/repos","events_url":"https://api.github.com/users/inlinestyle/events{/privacy}","received_events_url":"https://api.github.com/users/inlinestyle/received_events","type":"User","site_admin":false},"body":"We may want to bring this little bundle of joy into its own function","created_at":"2014-12-10T20:41:37Z","updated_at":"2014-12-10T20:41:37Z","html_url":"https://github.com/gamechanger/mongothon/pull/43#discussion_r21635266","pull_request_url":"https://api.github.com/repos/gamechanger/mongothon/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/comments/21635266"},"html":{"href":"https://github.com/gamechanger/mongothon/pull/43#discussion_r21635266"},"pull_request":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/gamechanger/mongothon/pulls/43","id":25852445,"html_url":"https://github.com/gamechanger/mongothon/pull/43","diff_url":"https://github.com/gamechanger/mongothon/pull/43.diff","patch_url":"https://github.com/gamechanger/mongothon/pull/43.patch","issue_url":"https://api.github.com/repos/gamechanger/mongothon/issues/43","number":43,"state":"open","locked":false,"title":"Add offline model creation capability","user":{"login":"thieman","id":1414305,"avatar_url":"https://avatars.githubusercontent.com/u/1414305?v=3","gravatar_id":"","url":"https://api.github.com/users/thieman","html_url":"https://github.com/thieman","followers_url":"https://api.github.com/users/thieman/followers","following_url":"https://api.github.com/users/thieman/following{/other_user}","gists_url":"https://api.github.com/users/thieman/gists{/gist_id}","starred_url":"https://api.github.com/users/thieman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thieman/subscriptions","organizations_url":"https://api.github.com/users/thieman/orgs","repos_url":"https://api.github.com/users/thieman/repos","events_url":"https://api.github.com/users/thieman/events{/privacy}","received_events_url":"https://api.github.com/users/thieman/received_events","type":"User","site_admin":false},"body":"Currently, Mongothon requires an existing connection to Mongo\r\nto create new models. It is usually desirable to have models available\r\nfor import at the module level, so this pattern requires instantiating\r\na Mongo connection at module import.\r\n\r\nThis creates a deploy-time dependency on Mongo for your app to start up.\r\nThis is risky as a short-lived inability to connect to Mongo could take\r\ndown your app completely. It would be preferred if an app would be able\r\nto start up, error while Mongo is down, and start functioning normally\r\nonce the Mongo connection is restored.\r\n\r\nThis commit adds a `create_model_offline` function to supplement the existing\r\n`create_model`. Instead of passing a fully fledged PyMongo collection,\r\nwhich requires a database connection upon instantiation, you can instead\r\npass a function to `create_model_offline`. The Model implementation will\r\nresolve that function when it first needs to actually access Mongo.\r\n\r\nThis should go a long ways towards minimizing the deploy-time risk described.\r\n\r\n@tleach ","created_at":"2014-12-10T20:25:40Z","updated_at":"2014-12-10T20:41:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2643ce46a914b21c1bab41017a4b6e8ae84d360","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gamechanger/mongothon/pulls/43/commits","review_comments_url":"https://api.github.com/repos/gamechanger/mongothon/pulls/43/comments","review_comment_url":"https://api.github.com/repos/gamechanger/mongothon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gamechanger/mongothon/issues/43/comments","statuses_url":"https://api.github.com/repos/gamechanger/mongothon/statuses/8dbbf9e7572c8a65f2119273b4114d96d53839df","head":{"label":"gamechanger:tnt-lazy-collections","ref":"tnt-lazy-collections","sha":"8dbbf9e7572c8a65f2119273b4114d96d53839df","user":{"login":"gamechanger","id":43876,"avatar_url":"https://avatars.githubusercontent.com/u/43876?v=3","gravatar_id":"","url":"https://api.github.com/users/gamechanger","html_url":"https://github.com/gamechanger","followers_url":"https://api.github.com/users/gamechanger/followers","following_url":"https://api.github.com/users/gamechanger/following{/other_user}","gists_url":"https://api.github.com/users/gamechanger/gists{/gist_id}","starred_url":"https://api.github.com/users/gamechanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamechanger/subscriptions","organizations_url":"https://api.github.com/users/gamechanger/orgs","repos_url":"https://api.github.com/users/gamechanger/repos","events_url":"https://api.github.com/users/gamechanger/events{/privacy}","received_events_url":"https://api.github.com/users/gamechanger/received_events","type":"Organization","site_admin":false},"repo":{"id":5939196,"name":"mongothon","full_name":"gamechanger/mongothon","owner":{"login":"gamechanger","id":43876,"avatar_url":"https://avatars.githubusercontent.com/u/43876?v=3","gravatar_id":"","url":"https://api.github.com/users/gamechanger","html_url":"https://github.com/gamechanger","followers_url":"https://api.github.com/users/gamechanger/followers","following_url":"https://api.github.com/users/gamechanger/following{/other_user}","gists_url":"https://api.github.com/users/gamechanger/gists{/gist_id}","starred_url":"https://api.github.com/users/gamechanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamechanger/subscriptions","organizations_url":"https://api.github.com/users/gamechanger/orgs","repos_url":"https://api.github.com/users/gamechanger/repos","events_url":"https://api.github.com/users/gamechanger/events{/privacy}","received_events_url":"https://api.github.com/users/gamechanger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gamechanger/mongothon","description":"A lightweight Mongo object-document mapping abstraction layer over PyMongo","fork":false,"url":"https://api.github.com/repos/gamechanger/mongothon","forks_url":"https://api.github.com/repos/gamechanger/mongothon/forks","keys_url":"https://api.github.com/repos/gamechanger/mongothon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gamechanger/mongothon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gamechanger/mongothon/teams","hooks_url":"https://api.github.com/repos/gamechanger/mongothon/hooks","issue_events_url":"https://api.github.com/repos/gamechanger/mongothon/issues/events{/number}","events_url":"https://api.github.com/repos/gamechanger/mongothon/events","assignees_url":"https://api.github.com/repos/gamechanger/mongothon/assignees{/user}","branches_url":"https://api.github.com/repos/gamechanger/mongothon/branches{/branch}","tags_url":"https://api.github.com/repos/gamechanger/mongothon/tags","blobs_url":"https://api.github.com/repos/gamechanger/mongothon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gamechanger/mongothon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gamechanger/mongothon/git/refs{/sha}","trees_url":"https://api.github.com/repos/gamechanger/mongothon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gamechanger/mongothon/statuses/{sha}","languages_url":"https://api.github.com/repos/gamechanger/mongothon/languages","stargazers_url":"https://api.github.com/repos/gamechanger/mongothon/stargazers","contributors_url":"https://api.github.com/repos/gamechanger/mongothon/contributors","subscribers_url":"https://api.github.com/repos/gamechanger/mongothon/subscribers","subscription_url":"https://api.github.com/repos/gamechanger/mongothon/subscription","commits_url":"https://api.github.com/repos/gamechanger/mongothon/commits{/sha}","git_commits_url":"https://api.github.com/repos/gamechanger/mongothon/git/commits{/sha}","comments_url":"https://api.github.com/repos/gamechanger/mongothon/comments{/number}","issue_comment_url":"https://api.github.com/repos/gamechanger/mongothon/issues/comments/{number}","contents_url":"https://api.github.com/repos/gamechanger/mongothon/contents/{+path}","compare_url":"https://api.github.com/repos/gamechanger/mongothon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gamechanger/mongothon/merges","archive_url":"https://api.github.com/repos/gamechanger/mongothon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gamechanger/mongothon/downloads","issues_url":"https://api.github.com/repos/gamechanger/mongothon/issues{/number}","pulls_url":"https://api.github.com/repos/gamechanger/mongothon/pulls{/number}","milestones_url":"https://api.github.com/repos/gamechanger/mongothon/milestones{/number}","notifications_url":"https://api.github.com/repos/gamechanger/mongothon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gamechanger/mongothon/labels{/name}","releases_url":"https://api.github.com/repos/gamechanger/mongothon/releases{/id}","created_at":"2012-09-24T18:53:47Z","updated_at":"2014-11-07T22:18:15Z","pushed_at":"2014-12-10T20:25:25Z","git_url":"git://github.com/gamechanger/mongothon.git","ssh_url":"git@github.com:gamechanger/mongothon.git","clone_url":"https://github.com/gamechanger/mongothon.git","svn_url":"https://github.com/gamechanger/mongothon","homepage":"http://gamechanger.github.io/mongothon","size":1328,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":14,"default_branch":"master"}},"base":{"label":"gamechanger:master","ref":"master","sha":"db5b383d2e1237ee672358dba4ef61b23b922ca9","user":{"login":"gamechanger","id":43876,"avatar_url":"https://avatars.githubusercontent.com/u/43876?v=3","gravatar_id":"","url":"https://api.github.com/users/gamechanger","html_url":"https://github.com/gamechanger","followers_url":"https://api.github.com/users/gamechanger/followers","following_url":"https://api.github.com/users/gamechanger/following{/other_user}","gists_url":"https://api.github.com/users/gamechanger/gists{/gist_id}","starred_url":"https://api.github.com/users/gamechanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamechanger/subscriptions","organizations_url":"https://api.github.com/users/gamechanger/orgs","repos_url":"https://api.github.com/users/gamechanger/repos","events_url":"https://api.github.com/users/gamechanger/events{/privacy}","received_events_url":"https://api.github.com/users/gamechanger/received_events","type":"Organization","site_admin":false},"repo":{"id":5939196,"name":"mongothon","full_name":"gamechanger/mongothon","owner":{"login":"gamechanger","id":43876,"avatar_url":"https://avatars.githubusercontent.com/u/43876?v=3","gravatar_id":"","url":"https://api.github.com/users/gamechanger","html_url":"https://github.com/gamechanger","followers_url":"https://api.github.com/users/gamechanger/followers","following_url":"https://api.github.com/users/gamechanger/following{/other_user}","gists_url":"https://api.github.com/users/gamechanger/gists{/gist_id}","starred_url":"https://api.github.com/users/gamechanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamechanger/subscriptions","organizations_url":"https://api.github.com/users/gamechanger/orgs","repos_url":"https://api.github.com/users/gamechanger/repos","events_url":"https://api.github.com/users/gamechanger/events{/privacy}","received_events_url":"https://api.github.com/users/gamechanger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gamechanger/mongothon","description":"A lightweight Mongo object-document mapping abstraction layer over PyMongo","fork":false,"url":"https://api.github.com/repos/gamechanger/mongothon","forks_url":"https://api.github.com/repos/gamechanger/mongothon/forks","keys_url":"https://api.github.com/repos/gamechanger/mongothon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gamechanger/mongothon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gamechanger/mongothon/teams","hooks_url":"https://api.github.com/repos/gamechanger/mongothon/hooks","issue_events_url":"https://api.github.com/repos/gamechanger/mongothon/issues/events{/number}","events_url":"https://api.github.com/repos/gamechanger/mongothon/events","assignees_url":"https://api.github.com/repos/gamechanger/mongothon/assignees{/user}","branches_url":"https://api.github.com/repos/gamechanger/mongothon/branches{/branch}","tags_url":"https://api.github.com/repos/gamechanger/mongothon/tags","blobs_url":"https://api.github.com/repos/gamechanger/mongothon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gamechanger/mongothon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gamechanger/mongothon/git/refs{/sha}","trees_url":"https://api.github.com/repos/gamechanger/mongothon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gamechanger/mongothon/statuses/{sha}","languages_url":"https://api.github.com/repos/gamechanger/mongothon/languages","stargazers_url":"https://api.github.com/repos/gamechanger/mongothon/stargazers","contributors_url":"https://api.github.com/repos/gamechanger/mongothon/contributors","subscribers_url":"https://api.github.com/repos/gamechanger/mongothon/subscribers","subscription_url":"https://api.github.com/repos/gamechanger/mongothon/subscription","commits_url":"https://api.github.com/repos/gamechanger/mongothon/commits{/sha}","git_commits_url":"https://api.github.com/repos/gamechanger/mongothon/git/commits{/sha}","comments_url":"https://api.github.com/repos/gamechanger/mongothon/comments{/number}","issue_comment_url":"https://api.github.com/repos/gamechanger/mongothon/issues/comments/{number}","contents_url":"https://api.github.com/repos/gamechanger/mongothon/contents/{+path}","compare_url":"https://api.github.com/repos/gamechanger/mongothon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gamechanger/mongothon/merges","archive_url":"https://api.github.com/repos/gamechanger/mongothon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gamechanger/mongothon/downloads","issues_url":"https://api.github.com/repos/gamechanger/mongothon/issues{/number}","pulls_url":"https://api.github.com/repos/gamechanger/mongothon/pulls{/number}","milestones_url":"https://api.github.com/repos/gamechanger/mongothon/milestones{/number}","notifications_url":"https://api.github.com/repos/gamechanger/mongothon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gamechanger/mongothon/labels{/name}","releases_url":"https://api.github.com/repos/gamechanger/mongothon/releases{/id}","created_at":"2012-09-24T18:53:47Z","updated_at":"2014-11-07T22:18:15Z","pushed_at":"2014-12-10T20:25:25Z","git_url":"git://github.com/gamechanger/mongothon.git","ssh_url":"git@github.com:gamechanger/mongothon.git","clone_url":"https://github.com/gamechanger/mongothon.git","svn_url":"https://github.com/gamechanger/mongothon","homepage":"http://gamechanger.github.io/mongothon","size":1328,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/43"},"html":{"href":"https://github.com/gamechanger/mongothon/pull/43"},"issue":{"href":"https://api.github.com/repos/gamechanger/mongothon/issues/43"},"comments":{"href":"https://api.github.com/repos/gamechanger/mongothon/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gamechanger/mongothon/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/gamechanger/mongothon/statuses/8dbbf9e7572c8a65f2119273b4114d96d53839df"}}}}