Skip to content

Commit

Permalink
show total number of bp in voucher page, fixes #328
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosp420 committed Jul 29, 2016
1 parent ad17ac4 commit 4777a81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Expand Up @@ -276,7 +276,7 @@ <h3 class="panel-title"><b>Sequence Information</b></h3>
{% for item in sequences %}
<tr>
<td><a href="/s/{{ item.code }}/{{ item.gene_code }}/">{{ item.gene_code }}</a></td>
<td>{{ item.sequence_length }}</td>
<td>{{ item.total_number_bp }}</td>
<td>{{ item.number_ambiguous_bp }}</td>
<td>{{ item.lab_person }}</td>
<td><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=nucleotide&term={{ item.accession }}[accn]&doptcmdl=GenBank">{{ item.accession }}</a></td>
Expand Down
12 changes: 9 additions & 3 deletions voseq/public_interface/views.py
Expand Up @@ -183,9 +183,15 @@ def show_voucher(request, voucher_code):
local_images_queryset = LocalImages.objects.filter(voucher=voucher_code)
images_queryset = list(chain(flickr_images_queryset, local_images_queryset))

seqs_queryset = Sequences.objects.filter(code=voucher_code).values('code', 'gene_code',
'number_ambiguous_bp',
'accession', 'lab_person')
seqs_queryset = Sequences.objects.filter(code=voucher_code).values(
'code',
'gene_code',
'number_ambiguous_bp',
'accession',
'lab_person',
'total_number_bp',
)
print(seqs_queryset)
sorted_seqs_queryset = sorted(seqs_queryset, key=lambda x: x['gene_code'].lower())

return render(request, 'public_interface/show_voucher.html',
Expand Down

0 comments on commit 4777a81

Please sign in to comment.