mirror of
https://github.com/kennethreitz-archive/fablib-api.git
synced 2026-06-05 07:16:13 +00:00
one more time
This commit is contained in:
@@ -202,14 +202,28 @@ api.add_resource(Document, '/<string:profile>/<path:document>')
|
||||
|
||||
class DocumentText(Resource):
|
||||
def get(self, profile, document):
|
||||
return trunk.get(key)
|
||||
try:
|
||||
u = UserModel.from_username(profile)
|
||||
d = DocumentModel.from_keys(profile, document)
|
||||
|
||||
except AttributeError:
|
||||
rest_abort(404)
|
||||
|
||||
return trunk.get(d.content)
|
||||
|
||||
api.add_resource(DocumentText, '/<string:profile>/<path:document>/text')
|
||||
|
||||
|
||||
class DocumentHTML(Resource):
|
||||
def get(self, profile, document):
|
||||
return trunk.get(key)
|
||||
try:
|
||||
u = UserModel.from_username(profile)
|
||||
d = DocumentModel.from_keys(profile, document)
|
||||
|
||||
except AttributeError:
|
||||
rest_abort(404)
|
||||
|
||||
return trunk.get(d.content, render=True)
|
||||
|
||||
api.add_resource(DocumentHTML, '/<string:profile>/<path:document>/html')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user