Commit 0354507e authored by Ryan Herbert's avatar Ryan Herbert

sample_set.py multi sample stat two types of headers

so that the view can remain agnostic of the provenence of the data
(whether from the db or extracted from a results or fused file).
parent e8cd2110
...@@ -654,7 +654,7 @@ def custom(): ...@@ -654,7 +654,7 @@ def custom():
group_ids=group_ids) group_ids=group_ids)
def getStatHeaders(): def getStatHeaders():
return ['set_id', 'set_name', 'set_info'] return [('set_id', 'db'), ('set_name', 'db'), ('set_info', 'db'), ('main_clone', 'parser')]
def getResultsFileStats(file_name, dest): def getResultsFileStats(file_name, dest):
file_path = "%s%s" % (defs.DIR_RESULTS, file_name) file_path = "%s%s" % (defs.DIR_RESULTS, file_name)
...@@ -697,15 +697,16 @@ def getStatData(results_file_ids): ...@@ -697,15 +697,16 @@ def getStatData(results_file_ids):
d = {} d = {}
set_type = res.sample_type set_type = res.sample_type
headers = getStatHeaders() headers = getStatHeaders()
for head in headers: for head, htype in headers:
d[head] = res[head] if htype == 'db':
d[head] = res[head]
d = getResultsFileStats(res.results_file, d) d = getResultsFileStats(res.results_file, d)
data.append(d) data.append(d)
return data return data
def multi_sample_stats(): def multi_sample_stats():
data = {} data = {}
data['headers'] = getStatHeaders() data['headers'] = [h for h, t in getStatHeaders()]
results = [] results = []
#if not auth.can_view_sample_set(): #if not auth.can_view_sample_set():
# return "permission denied %s" % res # return "permission denied %s" % res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment