From: Diane Trout Date: Thu, 4 Feb 2010 22:40:40 +0000 (+0000) Subject: Return affiliation, library name, and comment in the lanes_for json X-Git-Tag: 0.4.0~12 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=343570cd7096e048b3772719fcabd6d4a3cd1d79 Return affiliation, library name, and comment in the lanes_for json api call --- diff --git a/htsworkflow/frontend/experiments/experiments.py b/htsworkflow/frontend/experiments/experiments.py index 3e17e04..83b5414 100755 --- a/htsworkflow/frontend/experiments/experiments.py +++ b/htsworkflow/frontend/experiments/experiments.py @@ -91,14 +91,19 @@ def lanes_for(username=None): query.update({'library__affiliations__users__id': user.id}) lanes = Lane.objects.filter(**query).order_by('-flowcell__run_date') + result = [] for l in lanes: + affiliations = l.library.affiliations.all() + affiliations_list = [(a.id, a.name) for a in affiliations] result.append({ 'flowcell': l.flowcell.flowcell_id, 'run_date': l.flowcell.run_date.isoformat(), 'lane_number': l.lane_number, 'library': l.library.id, - 'comment': l.comment}) + 'library_name': l.library.library_name, + 'comment': l.comment, + 'affiliations': affiliations_list}) return result def lanes_for_json(request, username):