GitHub PullRequestReviewCommentEvent at 2014-12-01 11:19:30
Repository: spyne
Actor: dmugtasimov
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/arskom/spyne/pulls/comments/21082863","id":21082863,"diff_hunk":"@@ -362,14 +362,26 @@ def _sanitize_sqlalchemy_parameters(cls_dict, attrs):\n     if attrs.table_name is None:\n         attrs.table_name = table_name\n \n+    _cls_model = cls_dict.get('__sqla_model__', None)\n+    if attrs.sqla_model is None:\n+        attrs.sqla_model = _cls_model\n+\n     _cls_table = cls_dict.get('__table__', None)\n     if attrs.sqla_table is None:\n         attrs.sqla_table = _cls_table\n \n+    # More flexibility is given here: allow model inconsistent with its table if supplied\n+    # explicitly in __table__ attribute\n+    if attrs.sqla_table is None:\n+        # TODO(dmu) LOW: Is there a better check for SQLAlchemy model?\n+        if attrs.sqla_model and hasattr(attrs.sqla_model, '__table__'):\n+            attrs.sqla_table = attrs.sqla_model.__table__\n+\n     metadata = cls_dict.get('__metadata__', None)\n     if attrs.sqla_metadata is None:\n         attrs.sqla_metadata = metadata\n \n+    # TODO(dmu) LOW: Should we take __mapper_args__ from attrs.sqla_model.__mapper_args__?","path":"spyne/model/complex.py","position":23,"original_position":23,"commit_id":"45043f947688664a5f29c8f47d38c2406ae0c029","original_commit_id":"45043f947688664a5f29c8f47d38c2406ae0c029","user":{"login":"dmugtasimov","id":749833,"avatar_url":"https://avatars.githubusercontent.com/u/749833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmugtasimov","html_url":"https://github.com/dmugtasimov","followers_url":"https://api.github.com/users/dmugtasimov/followers","following_url":"https://api.github.com/users/dmugtasimov/following{/other_user}","gists_url":"https://api.github.com/users/dmugtasimov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmugtasimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmugtasimov/subscriptions","organizations_url":"https://api.github.com/users/dmugtasimov/orgs","repos_url":"https://api.github.com/users/dmugtasimov/repos","events_url":"https://api.github.com/users/dmugtasimov/events{/privacy}","received_events_url":"https://api.github.com/users/dmugtasimov/received_events","type":"User","site_admin":false},"body":"I do know :) We need this args, because we create a new instance of mapper.","created_at":"2014-12-01T11:19:30Z","updated_at":"2014-12-01T11:19:30Z","html_url":"https://github.com/arskom/spyne/pull/405#discussion_r21082863","pull_request_url":"https://api.github.com/repos/arskom/spyne/pulls/405","_links":{"self":{"href":"https://api.github.com/repos/arskom/spyne/pulls/comments/21082863"},"html":{"href":"https://github.com/arskom/spyne/pull/405#discussion_r21082863"},"pull_request":{"href":"https://api.github.com/repos/arskom/spyne/pulls/405"}}},"pull_request":{"url":"https://api.github.com/repos/arskom/spyne/pulls/405","id":25164905,"html_url":"https://github.com/arskom/spyne/pull/405","diff_url":"https://github.com/arskom/spyne/pull/405.diff","patch_url":"https://github.com/arskom/spyne/pull/405.patch","issue_url":"https://api.github.com/repos/arskom/spyne/issues/405","number":405,"state":"open","locked":false,"title":"custom_mapper","user":{"login":"dmugtasimov","id":749833,"avatar_url":"https://avatars.githubusercontent.com/u/749833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmugtasimov","html_url":"https://github.com/dmugtasimov","followers_url":"https://api.github.com/users/dmugtasimov/followers","following_url":"https://api.github.com/users/dmugtasimov/following{/other_user}","gists_url":"https://api.github.com/users/dmugtasimov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmugtasimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmugtasimov/subscriptions","organizations_url":"https://api.github.com/users/dmugtasimov/orgs","repos_url":"https://api.github.com/users/dmugtasimov/repos","events_url":"https://api.github.com/users/dmugtasimov/events{/privacy}","received_events_url":"https://api.github.com/users/dmugtasimov/received_events","type":"User","site_admin":false},"body":"Custom mapper support.\r\n\r\nIt is rough dirty draft solution made just for discussion. Please, DO NOT merge it.","created_at":"2014-11-27T17:55:48Z","updated_at":"2014-12-01T11:19:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7fb47cf378dd6035e4ddc0272b0b18346c5db91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/arskom/spyne/pulls/405/commits","review_comments_url":"https://api.github.com/repos/arskom/spyne/pulls/405/comments","review_comment_url":"https://api.github.com/repos/arskom/spyne/pulls/comments/{number}","comments_url":"https://api.github.com/repos/arskom/spyne/issues/405/comments","statuses_url":"https://api.github.com/repos/arskom/spyne/statuses/45043f947688664a5f29c8f47d38c2406ae0c029","head":{"label":"dmugtasimov:2_11/feature/custom_mapper","ref":"2_11/feature/custom_mapper","sha":"45043f947688664a5f29c8f47d38c2406ae0c029","user":{"login":"dmugtasimov","id":749833,"avatar_url":"https://avatars.githubusercontent.com/u/749833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmugtasimov","html_url":"https://github.com/dmugtasimov","followers_url":"https://api.github.com/users/dmugtasimov/followers","following_url":"https://api.github.com/users/dmugtasimov/following{/other_user}","gists_url":"https://api.github.com/users/dmugtasimov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmugtasimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmugtasimov/subscriptions","organizations_url":"https://api.github.com/users/dmugtasimov/orgs","repos_url":"https://api.github.com/users/dmugtasimov/repos","events_url":"https://api.github.com/users/dmugtasimov/events{/privacy}","received_events_url":"https://api.github.com/users/dmugtasimov/received_events","type":"User","site_admin":false},"repo":{"id":11741265,"name":"spyne","full_name":"dmugtasimov/spyne","owner":{"login":"dmugtasimov","id":749833,"avatar_url":"https://avatars.githubusercontent.com/u/749833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmugtasimov","html_url":"https://github.com/dmugtasimov","followers_url":"https://api.github.com/users/dmugtasimov/followers","following_url":"https://api.github.com/users/dmugtasimov/following{/other_user}","gists_url":"https://api.github.com/users/dmugtasimov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmugtasimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmugtasimov/subscriptions","organizations_url":"https://api.github.com/users/dmugtasimov/orgs","repos_url":"https://api.github.com/users/dmugtasimov/repos","events_url":"https://api.github.com/users/dmugtasimov/events{/privacy}","received_events_url":"https://api.github.com/users/dmugtasimov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmugtasimov/spyne","description":"A transport and architecture agnostic RPC library that focuses on exposing services with a well-defined API using popular protocols.","fork":true,"url":"https://api.github.com/repos/dmugtasimov/spyne","forks_url":"https://api.github.com/repos/dmugtasimov/spyne/forks","keys_url":"https://api.github.com/repos/dmugtasimov/spyne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmugtasimov/spyne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmugtasimov/spyne/teams","hooks_url":"https://api.github.com/repos/dmugtasimov/spyne/hooks","issue_events_url":"https://api.github.com/repos/dmugtasimov/spyne/issues/events{/number}","events_url":"https://api.github.com/repos/dmugtasimov/spyne/events","assignees_url":"https://api.github.com/repos/dmugtasimov/spyne/assignees{/user}","branches_url":"https://api.github.com/repos/dmugtasimov/spyne/branches{/branch}","tags_url":"https://api.github.com/repos/dmugtasimov/spyne/tags","blobs_url":"https://api.github.com/repos/dmugtasimov/spyne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmugtasimov/spyne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmugtasimov/spyne/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmugtasimov/spyne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmugtasimov/spyne/statuses/{sha}","languages_url":"https://api.github.com/repos/dmugtasimov/spyne/languages","stargazers_url":"https://api.github.com/repos/dmugtasimov/spyne/stargazers","contributors_url":"https://api.github.com/repos/dmugtasimov/spyne/contributors","subscribers_url":"https://api.github.com/repos/dmugtasimov/spyne/subscribers","subscription_url":"https://api.github.com/repos/dmugtasimov/spyne/subscription","commits_url":"https://api.github.com/repos/dmugtasimov/spyne/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmugtasimov/spyne/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmugtasimov/spyne/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmugtasimov/spyne/issues/comments/{number}","contents_url":"https://api.github.com/repos/dmugtasimov/spyne/contents/{+path}","compare_url":"https://api.github.com/repos/dmugtasimov/spyne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmugtasimov/spyne/merges","archive_url":"https://api.github.com/repos/dmugtasimov/spyne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmugtasimov/spyne/downloads","issues_url":"https://api.github.com/repos/dmugtasimov/spyne/issues{/number}","pulls_url":"https://api.github.com/repos/dmugtasimov/spyne/pulls{/number}","milestones_url":"https://api.github.com/repos/dmugtasimov/spyne/milestones{/number}","notifications_url":"https://api.github.com/repos/dmugtasimov/spyne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmugtasimov/spyne/labels{/name}","releases_url":"https://api.github.com/repos/dmugtasimov/spyne/releases{/id}","created_at":"2013-07-29T14:15:59Z","updated_at":"2013-08-11T20:45:40Z","pushed_at":"2014-11-27T17:53:29Z","git_url":"git://github.com/dmugtasimov/spyne.git","ssh_url":"git@github.com:dmugtasimov/spyne.git","clone_url":"https://github.com/dmugtasimov/spyne.git","svn_url":"https://github.com/dmugtasimov/spyne","homepage":"spyne.io","size":10538,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arskom:2_11","ref":"2_11","sha":"2582be0bb4257fb23273e0624c6fcae1275e7362","user":{"login":"arskom","id":168374,"avatar_url":"https://avatars.githubusercontent.com/u/168374?v=3","gravatar_id":"","url":"https://api.github.com/users/arskom","html_url":"https://github.com/arskom","followers_url":"https://api.github.com/users/arskom/followers","following_url":"https://api.github.com/users/arskom/following{/other_user}","gists_url":"https://api.github.com/users/arskom/gists{/gist_id}","starred_url":"https://api.github.com/users/arskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arskom/subscriptions","organizations_url":"https://api.github.com/users/arskom/orgs","repos_url":"https://api.github.com/users/arskom/repos","events_url":"https://api.github.com/users/arskom/events{/privacy}","received_events_url":"https://api.github.com/users/arskom/received_events","type":"Organization","site_admin":false},"repo":{"id":792753,"name":"spyne","full_name":"arskom/spyne","owner":{"login":"arskom","id":168374,"avatar_url":"https://avatars.githubusercontent.com/u/168374?v=3","gravatar_id":"","url":"https://api.github.com/users/arskom","html_url":"https://github.com/arskom","followers_url":"https://api.github.com/users/arskom/followers","following_url":"https://api.github.com/users/arskom/following{/other_user}","gists_url":"https://api.github.com/users/arskom/gists{/gist_id}","starred_url":"https://api.github.com/users/arskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arskom/subscriptions","organizations_url":"https://api.github.com/users/arskom/orgs","repos_url":"https://api.github.com/users/arskom/repos","events_url":"https://api.github.com/users/arskom/events{/privacy}","received_events_url":"https://api.github.com/users/arskom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arskom/spyne","description":"A transport and architecture agnostic RPC library that focuses on exposing services with a well-defined API using popular protocols.","fork":false,"url":"https://api.github.com/repos/arskom/spyne","forks_url":"https://api.github.com/repos/arskom/spyne/forks","keys_url":"https://api.github.com/repos/arskom/spyne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arskom/spyne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arskom/spyne/teams","hooks_url":"https://api.github.com/repos/arskom/spyne/hooks","issue_events_url":"https://api.github.com/repos/arskom/spyne/issues/events{/number}","events_url":"https://api.github.com/repos/arskom/spyne/events","assignees_url":"https://api.github.com/repos/arskom/spyne/assignees{/user}","branches_url":"https://api.github.com/repos/arskom/spyne/branches{/branch}","tags_url":"https://api.github.com/repos/arskom/spyne/tags","blobs_url":"https://api.github.com/repos/arskom/spyne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arskom/spyne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arskom/spyne/git/refs{/sha}","trees_url":"https://api.github.com/repos/arskom/spyne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arskom/spyne/statuses/{sha}","languages_url":"https://api.github.com/repos/arskom/spyne/languages","stargazers_url":"https://api.github.com/repos/arskom/spyne/stargazers","contributors_url":"https://api.github.com/repos/arskom/spyne/contributors","subscribers_url":"https://api.github.com/repos/arskom/spyne/subscribers","subscription_url":"https://api.github.com/repos/arskom/spyne/subscription","commits_url":"https://api.github.com/repos/arskom/spyne/commits{/sha}","git_commits_url":"https://api.github.com/repos/arskom/spyne/git/commits{/sha}","comments_url":"https://api.github.com/repos/arskom/spyne/comments{/number}","issue_comment_url":"https://api.github.com/repos/arskom/spyne/issues/comments/{number}","contents_url":"https://api.github.com/repos/arskom/spyne/contents/{+path}","compare_url":"https://api.github.com/repos/arskom/spyne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arskom/spyne/merges","archive_url":"https://api.github.com/repos/arskom/spyne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arskom/spyne/downloads","issues_url":"https://api.github.com/repos/arskom/spyne/issues{/number}","pulls_url":"https://api.github.com/repos/arskom/spyne/pulls{/number}","milestones_url":"https://api.github.com/repos/arskom/spyne/milestones{/number}","notifications_url":"https://api.github.com/repos/arskom/spyne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arskom/spyne/labels{/name}","releases_url":"https://api.github.com/repos/arskom/spyne/releases{/id}","created_at":"2010-07-23T06:26:28Z","updated_at":"2014-11-28T20:09:56Z","pushed_at":"2014-11-28T13:24:59Z","git_url":"git://github.com/arskom/spyne.git","ssh_url":"git@github.com:arskom/spyne.git","clone_url":"https://github.com/arskom/spyne.git","svn_url":"https://github.com/arskom/spyne","homepage":"spyne.io","size":15455,"stargazers_count":341,"watchers_count":341,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":153,"mirror_url":null,"open_issues_count":33,"forks":153,"open_issues":33,"watchers":341,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arskom/spyne/pulls/405"},"html":{"href":"https://github.com/arskom/spyne/pull/405"},"issue":{"href":"https://api.github.com/repos/arskom/spyne/issues/405"},"comments":{"href":"https://api.github.com/repos/arskom/spyne/issues/405/comments"},"review_comments":{"href":"https://api.github.com/repos/arskom/spyne/pulls/405/comments"},"review_comment":{"href":"https://api.github.com/repos/arskom/spyne/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/arskom/spyne/pulls/405/commits"},"statuses":{"href":"https://api.github.com/repos/arskom/spyne/statuses/45043f947688664a5f29c8f47d38c2406ae0c029"}}}}