def download_name(self, project, ty, _format):
"""Get the filename (without) path of the file which should be downloaded.
This function does not check if this filename actually exists!"""
# TODO: Check if ty is valid
name = self._project_name_latin_encoded(project)
filename = '%s_%s_%s_%s.zip' % (str(project.id), name, ty, _format) # Example: 123_feynman_tasks_json.zip
filename = secure_filename(filename)
return filename
评论列表
文章目录