This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start v1 refactor. Kill validators. Add mixins (Createable, Findable).
- Loading branch information
1 parent
6c73547
commit 8745474
Showing
8 changed files
with
45 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,4 @@ htmlcov | |
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
go.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Findable(object): | ||
def find(self, id): | ||
api_resp = self.call('get', '{0}/{1}'.format(self.path, id)) | ||
return api_resp | ||
|
||
|
||
class Deleteable(object): | ||
def delete(self, id): | ||
self.call('delete', '{0}/{1}'.format(self.path, id)) | ||
|
||
|
||
class Createable(object): | ||
def create(self, obj): | ||
api_resp = self.call('post', self.path, data=obj, extra_headers={'Content-Type': 'application/json'}) | ||
return api_resp | ||
|
||
|
||
class Searchable(object): | ||
def search(self, params=None): | ||
api_resp = self.call('get', self.path, params=params) | ||
return api_resp | ||
|
||
|
||
class Updateable(object): | ||
def update(self, id, obj): | ||
api_resp = self.call('put', '{0}/{1}'.format(self.path, id), data=obj, extra_headers={'Content-Type': 'application/json'}) | ||
return api_resp |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.