def _xls_file_io(self):
'''
pulls the xls file from remote storage
this should be used sparingly
'''
file_path = self.xls.name
default_storage = get_storage_class()()
if file_path != '' and default_storage.exists(file_path):
with default_storage.open(file_path) as ff:
if file_path.endswith('.csv'):
return convert_csv_to_xls(ff.read())
else:
return StringIO(ff.read())
评论列表
文章目录