diff options
author | 2011-11-08 11:29:24 +0100 | |
---|---|---|
committer | 2011-11-08 23:00:41 +0100 | |
commit | 88f3b88a17408c312b74c82f5e869d8cf76591c2 (patch) | |
tree | 2ff91fa8d05904655adcd746dbfcc7dd0447d656 /github3/handlers/base.py | |
parent | Abstract and decouple converters (diff) | |
download | python-github3-88f3b88a17408c312b74c82f5e869d8cf76591c2.tar.xz python-github3-88f3b88a17408c312b74c82f5e869d8cf76591c2.zip |
Added post_resource to handler
Diffstat (limited to 'github3/handlers/base.py')
-rw-r--r-- | github3/handlers/base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/github3/handlers/base.py b/github3/handlers/base.py index 858ca51..9e5a110 100644 --- a/github3/handlers/base.py +++ b/github3/handlers/base.py @@ -55,3 +55,10 @@ class Handler(object): converter.inject(model) return converter.loads(raw_resource) + def _post_resource(self, resource, data, model=None): + """ Handler request to create a resource """ + + raw_resource = self._gh.post(resource, data=data) + converter = self._get_converter() + converter.inject(model) + return converter.loads(raw_resource) |