1 # Create your views here.
2 from gaworkflow.frontend.fctracker.models import Library
3 from django.http import HttpResponse
5 #from django.db.models import base
8 library_list = Library.objects.all() #.order_by('-pub_date')
9 rep_string = '<a href="/library/%s/">%s - %s (%s)</a>'
10 output = '<br />\n'.join([rep_string \
14 l.library_species.scientific_name) for l in library_list])
15 return HttpResponse(output)
17 def library_to_flowcells(request, lib_id):
20 lib = Library.objects.get(library_id=lib_id)
22 return HttpResponse("Library %s does not exist" % (lib_id))
26 output.extend([ '%s - Lane 1' % (fc.flowcell_id) for fc in lib.lane_1_library.all() ])
27 output.extend([ '%s - Lane 2' % (fc.flowcell_id) for fc in lib.lane_2_library.all() ])
28 output.extend([ '%s - Lane 3' % (fc.flowcell_id) for fc in lib.lane_3_library.all() ])
29 output.extend([ '%s - Lane 4' % (fc.flowcell_id) for fc in lib.lane_4_library.all() ])
30 output.extend([ '%s - Lane 5' % (fc.flowcell_id) for fc in lib.lane_5_library.all() ])
31 output.extend([ '%s - Lane 6' % (fc.flowcell_id) for fc in lib.lane_6_library.all() ])
32 output.extend([ '%s - Lane 7' % (fc.flowcell_id) for fc in lib.lane_7_library.all() ])
33 output.extend([ '%s - Lane 8' % (fc.flowcell_id) for fc in lib.lane_8_library.all() ])
35 return HttpResponse('<br />\n'.join(output))