Commit 3026e693 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

file.py sequence_file.py move utility functions to model

namely get_sequence_file_sample_sets and get_sequence_file_config_ids
parent a3b9b6cb
......@@ -570,20 +570,6 @@ def delete_sequence_file(seq_id):
else:
return error_message('you need admin permission to delete this file')
def get_sequence_file_sample_sets(sequence_file_id):
query = db((db.sample_set_membership.sequence_file_id == sequence_file_id)).select(db.sample_set_membership.sample_set_id)
sample_set_ids = []
for row in query:
sample_set_ids.append(row.sample_set_id)
return sample_set_ids
def get_sequence_file_config_ids(sequence_file_id):
query = db((db.results_file.sequence_file_id == sequence_file_id)).select(db.results_file.config_id)
config_ids = []
for row in query:
config_ids.append(row.config_id)
return config_ids
def delete():
'''
Called (via request) with:
......
......@@ -107,3 +107,17 @@ def get_run_id(file_id):
run_id = row.id
return run_id
def get_sequence_file_sample_sets(sequence_file_id):
query = db((db.sample_set_membership.sequence_file_id == sequence_file_id)).select(db.sample_set_membership.sample_set_id)
sample_set_ids = []
for row in query:
sample_set_ids.append(row.sample_set_id)
return sample_set_ids
def get_sequence_file_config_ids(sequence_file_id):
query = db((db.results_file.sequence_file_id == sequence_file_id)).select(db.results_file.config_id)
config_ids = []
for row in query:
config_ids.append(row.config_id)
return config_ids
Supports Markdown
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