Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
description now shown on paginated sequence tables + has to be set to…
… None when not available (code handles this now as well)
  • Loading branch information
proost committed Nov 20, 2015
1 parent 57fcc49 commit e988de0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/species.py
Expand Up @@ -32,7 +32,7 @@ def add_species_from_fasta(filename, species_code, species_name, contains_descri

new_sequences = []
for name, sequence in fasta_data.sequences.items():
description = ''
description = None
if contains_description:
parts = name.split('|', 1)
name = parts[0].strip()
Expand Down
3 changes: 2 additions & 1 deletion planet/models/sequences.py
Expand Up @@ -33,9 +33,10 @@ class Sequence(db.Model):
xrefs = db.relationship('XRef', secondary=sequence_xref, lazy='dynamic')

def __init__(self, species_id, name, coding_sequence, type='protein_coding', is_chloroplast=False,
is_mitochondrial=False):
is_mitochondrial=False, description=None):
self.species_id = species_id
self.name = name
self.description = description
self.coding_sequence = coding_sequence
self.type = type
self.is_chloroplast = is_chloroplast
Expand Down
1 change: 1 addition & 0 deletions planet/templates/pagination/sequences.html
Expand Up @@ -5,6 +5,7 @@
<tr>
<td><a href="{{ url_for('sequence.sequence_view', sequence_id=sequence.id) }}">{{ sequence.name }}</a></td>
<td><a href="{{ url_for('species.species_view', species_id=sequence.species_id) }}"><em>{{ sequence.species.name }}</em></a></td>
<td>{% if sequence.description %}{{ sequence.description|truncate(60) }}{% else %}<span class="text-muted">No description available</span>{% endif %}</td>
<td>{{ sequence.type }}</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit e988de0

Please sign in to comment.