diff options
-rw-r--r-- | wqflask/wqflask/show_trait/export_trait_data.py | 4 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/wqflask/wqflask/show_trait/export_trait_data.py b/wqflask/wqflask/show_trait/export_trait_data.py index 2d76b935..f2132966 100644 --- a/wqflask/wqflask/show_trait/export_trait_data.py +++ b/wqflask/wqflask/show_trait/export_trait_data.py @@ -1,7 +1,7 @@ import simplejson as json from pprint import pformat as pf - +from functools import cmp_to_key from base.trait import create_trait from base import data_set @@ -46,7 +46,7 @@ def get_export_metadata(trait_id, dataset_name): def dict_to_sorted_list(dictionary): sorted_list = [item for item in list(dictionary.items())] - sorted_list = sorted(sorted_list, cmp=cmp_samples) + sorted_list = sorted(sorted_list, key=cmp_to_key(cmp_samples)) sorted_values = [item[1] for item in sorted_list] return sorted_values diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index e8d17613..c37be418 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -376,7 +376,7 @@ def export_trait_excel(): logger.info("sample_data - type: %s -- size: %s" % (type(sample_data), len(sample_data))) - buff = io.StringIO() + buff = io.BytesIO() workbook = xlsxwriter.Workbook(buff, {'in_memory': True}) worksheet = workbook.add_worksheet() for i, row in enumerate(sample_data): |