-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GET for Manifestations, Copyrights, Rights, and Works
- Loading branch information
Showing
6 changed files
with
131 additions
and
23 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
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
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,22 @@ | ||
from flask import Blueprint | ||
from flask_restful import Resource, Api | ||
|
||
from coalaip import CoalaIp, entities | ||
from coalaip_bigchaindb.plugin import Plugin | ||
from web.utils import get_bigchaindb_api_url | ||
|
||
|
||
coalaip = CoalaIp(Plugin(get_bigchaindb_api_url())) | ||
|
||
work_views = Blueprint('work_views', __name__) | ||
work_api = Api(work_views) | ||
|
||
|
||
class WorkApi(Resource): | ||
def get(self, entity_id): | ||
work = entities.Work.from_persist_id( | ||
entity_id, plugin=coalaip.plugin, force_load=True) | ||
return work.to_jsonld() | ||
|
||
|
||
work_api.add_resource(WorkApi, '/work/<entity_id>', strict_slashes=False) |