{"action":"created","comment":{"url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/comments/65947382","id":65947382,"diff_hunk":"@@ -41,11 +42,56 @@ def configure_createfor(self, ns, definition):\n         @response(definition.response_schema)\n         def create(**path_data):\n             request_data = load_request_data(definition.request_schema)\n-            response_data = definition.func(**merge_data(path_data, request_data))\n+            response_data = require_response_data(definition.func(**merge_data(path_data, request_data)))\n             return dump_response_data(definition.response_schema, response_data, Operation.CreateFor.value.default_code)\n \n         create.__doc__ = \"Create a new {} relative to a {}\".format(pluralize(ns.object_name), ns.subject_name)\n \n+    def configure_deletefor(self, ns, definition):\n+        \"\"\"\n+        Register a delete-for relation endpoint.\n+\n+        The definition's func should be a delete function, which must:\n+        - accept kwargs for path data\n+        - return truthy/falsey\n+\n+        :param ns: the namespace\n+        :param definition: the endpoint definition\n+\n+        \"\"\"\n+        @self.graph.route(ns.instance_path, Operation.DeleteFor, ns)\n+        def delete(**path_data):\n+            require_response_data(definition.func(**path_data))\n+            return \"\", Operation.DeleteFor.value.default_code\n+\n+        delete.__doc__ = \"Delete a {} relative to a {}\".format(pluralize(ns.object_name), ns.subject_name)\n+\n+    def configure_replacefor(self, ns, definition):","path":"microcosm_flask/conventions/relation.py","position":37,"original_position":37,"commit_id":"3b62f3698626cad76c17a2f7e838568c89ebf3a3","original_commit_id":"3b62f3698626cad76c17a2f7e838568c89ebf3a3","user":{"login":"jessemyers","id":477722,"avatar_url":"https://avatars.githubusercontent.com/u/477722?v=3","gravatar_id":"","url":"https://api.github.com/users/jessemyers","html_url":"https://github.com/jessemyers","followers_url":"https://api.github.com/users/jessemyers/followers","following_url":"https://api.github.com/users/jessemyers/following{/other_user}","gists_url":"https://api.github.com/users/jessemyers/gists{/gist_id}","starred_url":"https://api.github.com/users/jessemyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessemyers/subscriptions","organizations_url":"https://api.github.com/users/jessemyers/orgs","repos_url":"https://api.github.com/users/jessemyers/repos","events_url":"https://api.github.com/users/jessemyers/events{/privacy}","received_events_url":"https://api.github.com/users/jessemyers/received_events","type":"User","site_admin":false},"body":"I'd like to be convinced that this endpoint makes sense as a convention.\r\n\r\nIn my mind, we only use replace when we already have an object id (whether or not it exists in the database yet). I don't see why we'd operate on the relation in this case instead of the regular CRUD location.","created_at":"2016-06-06T18:55:16Z","updated_at":"2016-06-06T18:55:16Z","html_url":"https://github.com/globality-corp/microcosm-flask/pull/38#discussion_r65947382","pull_request_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/comments/65947382"},"html":{"href":"https://github.com/globality-corp/microcosm-flask/pull/38#discussion_r65947382"},"pull_request":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38","id":72758213,"html_url":"https://github.com/globality-corp/microcosm-flask/pull/38","diff_url":"https://github.com/globality-corp/microcosm-flask/pull/38.diff","patch_url":"https://github.com/globality-corp/microcosm-flask/pull/38.patch","issue_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/38","number":38,"state":"open","locked":false,"title":"add DeleteFor and ReplaceFor relation operations; add require_response_data decorator to relational CRUD operators","user":{"login":"adamhadani","id":139888,"avatar_url":"https://avatars.githubusercontent.com/u/139888?v=3","gravatar_id":"","url":"https://api.github.com/users/adamhadani","html_url":"https://github.com/adamhadani","followers_url":"https://api.github.com/users/adamhadani/followers","following_url":"https://api.github.com/users/adamhadani/following{/other_user}","gists_url":"https://api.github.com/users/adamhadani/gists{/gist_id}","starred_url":"https://api.github.com/users/adamhadani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamhadani/subscriptions","organizations_url":"https://api.github.com/users/adamhadani/orgs","repos_url":"https://api.github.com/users/adamhadani/repos","events_url":"https://api.github.com/users/adamhadani/events{/privacy}","received_events_url":"https://api.github.com/users/adamhadani/received_events","type":"User","site_admin":false},"body":"- adds the two missing operations for the 'relation' Operator support: Delete and Replace.\n- adds the require_response_data decorator that's been used in the main CRUD Operator commands to the relational equivalent","created_at":"2016-06-06T18:48:55Z","updated_at":"2016-06-06T18:55:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"881bd0d05efcfe4b3c136fb58183706bcf91de4d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38/commits","review_comments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38/comments","review_comment_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/38/comments","statuses_url":"https://api.github.com/repos/globality-corp/microcosm-flask/statuses/3b62f3698626cad76c17a2f7e838568c89ebf3a3","head":{"label":"globality-corp:feature/ah-relation-delete-replace","ref":"feature/ah-relation-delete-replace","sha":"3b62f3698626cad76c17a2f7e838568c89ebf3a3","user":{"login":"globality-corp","id":11172782,"avatar_url":"https://avatars.githubusercontent.com/u/11172782?v=3","gravatar_id":"","url":"https://api.github.com/users/globality-corp","html_url":"https://github.com/globality-corp","followers_url":"https://api.github.com/users/globality-corp/followers","following_url":"https://api.github.com/users/globality-corp/following{/other_user}","gists_url":"https://api.github.com/users/globality-corp/gists{/gist_id}","starred_url":"https://api.github.com/users/globality-corp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globality-corp/subscriptions","organizations_url":"https://api.github.com/users/globality-corp/orgs","repos_url":"https://api.github.com/users/globality-corp/repos","events_url":"https://api.github.com/users/globality-corp/events{/privacy}","received_events_url":"https://api.github.com/users/globality-corp/received_events","type":"Organization","site_admin":false},"repo":{"id":53442595,"name":"microcosm-flask","full_name":"globality-corp/microcosm-flask","owner":{"login":"globality-corp","id":11172782,"avatar_url":"https://avatars.githubusercontent.com/u/11172782?v=3","gravatar_id":"","url":"https://api.github.com/users/globality-corp","html_url":"https://github.com/globality-corp","followers_url":"https://api.github.com/users/globality-corp/followers","following_url":"https://api.github.com/users/globality-corp/following{/other_user}","gists_url":"https://api.github.com/users/globality-corp/gists{/gist_id}","starred_url":"https://api.github.com/users/globality-corp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globality-corp/subscriptions","organizations_url":"https://api.github.com/users/globality-corp/orgs","repos_url":"https://api.github.com/users/globality-corp/repos","events_url":"https://api.github.com/users/globality-corp/events{/privacy}","received_events_url":"https://api.github.com/users/globality-corp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/globality-corp/microcosm-flask","description":"Opinionated Flask services","fork":false,"url":"https://api.github.com/repos/globality-corp/microcosm-flask","forks_url":"https://api.github.com/repos/globality-corp/microcosm-flask/forks","keys_url":"https://api.github.com/repos/globality-corp/microcosm-flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globality-corp/microcosm-flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globality-corp/microcosm-flask/teams","hooks_url":"https://api.github.com/repos/globality-corp/microcosm-flask/hooks","issue_events_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/events{/number}","events_url":"https://api.github.com/repos/globality-corp/microcosm-flask/events","assignees_url":"https://api.github.com/repos/globality-corp/microcosm-flask/assignees{/user}","branches_url":"https://api.github.com/repos/globality-corp/microcosm-flask/branches{/branch}","tags_url":"https://api.github.com/repos/globality-corp/microcosm-flask/tags","blobs_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globality-corp/microcosm-flask/statuses/{sha}","languages_url":"https://api.github.com/repos/globality-corp/microcosm-flask/languages","stargazers_url":"https://api.github.com/repos/globality-corp/microcosm-flask/stargazers","contributors_url":"https://api.github.com/repos/globality-corp/microcosm-flask/contributors","subscribers_url":"https://api.github.com/repos/globality-corp/microcosm-flask/subscribers","subscription_url":"https://api.github.com/repos/globality-corp/microcosm-flask/subscription","commits_url":"https://api.github.com/repos/globality-corp/microcosm-flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/globality-corp/microcosm-flask/contents/{+path}","compare_url":"https://api.github.com/repos/globality-corp/microcosm-flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globality-corp/microcosm-flask/merges","archive_url":"https://api.github.com/repos/globality-corp/microcosm-flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globality-corp/microcosm-flask/downloads","issues_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues{/number}","pulls_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls{/number}","milestones_url":"https://api.github.com/repos/globality-corp/microcosm-flask/milestones{/number}","notifications_url":"https://api.github.com/repos/globality-corp/microcosm-flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globality-corp/microcosm-flask/labels{/name}","releases_url":"https://api.github.com/repos/globality-corp/microcosm-flask/releases{/id}","deployments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/deployments","created_at":"2016-03-08T20:23:55Z","updated_at":"2016-03-09T19:15:55Z","pushed_at":"2016-06-06T18:48:55Z","git_url":"git://github.com/globality-corp/microcosm-flask.git","ssh_url":"git@github.com:globality-corp/microcosm-flask.git","clone_url":"https://github.com/globality-corp/microcosm-flask.git","svn_url":"https://github.com/globality-corp/microcosm-flask","homepage":null,"size":135,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"globality-corp:develop","ref":"develop","sha":"561daf4e17d4980e8e84f044c27cebefc0de63b7","user":{"login":"globality-corp","id":11172782,"avatar_url":"https://avatars.githubusercontent.com/u/11172782?v=3","gravatar_id":"","url":"https://api.github.com/users/globality-corp","html_url":"https://github.com/globality-corp","followers_url":"https://api.github.com/users/globality-corp/followers","following_url":"https://api.github.com/users/globality-corp/following{/other_user}","gists_url":"https://api.github.com/users/globality-corp/gists{/gist_id}","starred_url":"https://api.github.com/users/globality-corp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globality-corp/subscriptions","organizations_url":"https://api.github.com/users/globality-corp/orgs","repos_url":"https://api.github.com/users/globality-corp/repos","events_url":"https://api.github.com/users/globality-corp/events{/privacy}","received_events_url":"https://api.github.com/users/globality-corp/received_events","type":"Organization","site_admin":false},"repo":{"id":53442595,"name":"microcosm-flask","full_name":"globality-corp/microcosm-flask","owner":{"login":"globality-corp","id":11172782,"avatar_url":"https://avatars.githubusercontent.com/u/11172782?v=3","gravatar_id":"","url":"https://api.github.com/users/globality-corp","html_url":"https://github.com/globality-corp","followers_url":"https://api.github.com/users/globality-corp/followers","following_url":"https://api.github.com/users/globality-corp/following{/other_user}","gists_url":"https://api.github.com/users/globality-corp/gists{/gist_id}","starred_url":"https://api.github.com/users/globality-corp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globality-corp/subscriptions","organizations_url":"https://api.github.com/users/globality-corp/orgs","repos_url":"https://api.github.com/users/globality-corp/repos","events_url":"https://api.github.com/users/globality-corp/events{/privacy}","received_events_url":"https://api.github.com/users/globality-corp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/globality-corp/microcosm-flask","description":"Opinionated Flask services","fork":false,"url":"https://api.github.com/repos/globality-corp/microcosm-flask","forks_url":"https://api.github.com/repos/globality-corp/microcosm-flask/forks","keys_url":"https://api.github.com/repos/globality-corp/microcosm-flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globality-corp/microcosm-flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globality-corp/microcosm-flask/teams","hooks_url":"https://api.github.com/repos/globality-corp/microcosm-flask/hooks","issue_events_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/events{/number}","events_url":"https://api.github.com/repos/globality-corp/microcosm-flask/events","assignees_url":"https://api.github.com/repos/globality-corp/microcosm-flask/assignees{/user}","branches_url":"https://api.github.com/repos/globality-corp/microcosm-flask/branches{/branch}","tags_url":"https://api.github.com/repos/globality-corp/microcosm-flask/tags","blobs_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globality-corp/microcosm-flask/statuses/{sha}","languages_url":"https://api.github.com/repos/globality-corp/microcosm-flask/languages","stargazers_url":"https://api.github.com/repos/globality-corp/microcosm-flask/stargazers","contributors_url":"https://api.github.com/repos/globality-corp/microcosm-flask/contributors","subscribers_url":"https://api.github.com/repos/globality-corp/microcosm-flask/subscribers","subscription_url":"https://api.github.com/repos/globality-corp/microcosm-flask/subscription","commits_url":"https://api.github.com/repos/globality-corp/microcosm-flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/globality-corp/microcosm-flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/globality-corp/microcosm-flask/contents/{+path}","compare_url":"https://api.github.com/repos/globality-corp/microcosm-flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globality-corp/microcosm-flask/merges","archive_url":"https://api.github.com/repos/globality-corp/microcosm-flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globality-corp/microcosm-flask/downloads","issues_url":"https://api.github.com/repos/globality-corp/microcosm-flask/issues{/number}","pulls_url":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls{/number}","milestones_url":"https://api.github.com/repos/globality-corp/microcosm-flask/milestones{/number}","notifications_url":"https://api.github.com/repos/globality-corp/microcosm-flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globality-corp/microcosm-flask/labels{/name}","releases_url":"https://api.github.com/repos/globality-corp/microcosm-flask/releases{/id}","deployments_url":"https://api.github.com/repos/globality-corp/microcosm-flask/deployments","created_at":"2016-03-08T20:23:55Z","updated_at":"2016-03-09T19:15:55Z","pushed_at":"2016-06-06T18:48:55Z","git_url":"git://github.com/globality-corp/microcosm-flask.git","ssh_url":"git@github.com:globality-corp/microcosm-flask.git","clone_url":"https://github.com/globality-corp/microcosm-flask.git","svn_url":"https://github.com/globality-corp/microcosm-flask","homepage":null,"size":135,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38"},"html":{"href":"https://github.com/globality-corp/microcosm-flask/pull/38"},"issue":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/38"},"comments":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/globality-corp/microcosm-flask/statuses/3b62f3698626cad76c17a2f7e838568c89ebf3a3"}}}}
{"actor":{"display_login":"jessemyers"}}