Added "build_previews" call

This commit is contained in:
Eibriel
2015-05-08 11:30:28 -03:00
parent 3069a45c24
commit fa1f720123

View File

@@ -13,6 +13,7 @@ class File(List, Find, Create, Post, Update, Delete, Replace):
"""
path = "files"
file_server_path = "file_server/file"
build_previews_server_path = "file_server/build_previews"
def post_file(self, file_path, name=None, api=None):
"""Stores a file on the database or static folder.
@@ -27,3 +28,12 @@ class File(List, Find, Create, Post, Update, Delete, Replace):
# self.error = None
# self.merge(new_attributes)
return self.success()
def build_previews(self, path, api=None):
"""Stores a file on the database or static folder.
:param path: A file path
"""
api = api or self.api
url = utils.join_url(self.build_previews_server_path, path)
api.get(url)
return self.success()