Skip to content
Snippets Groups Projects
Commit b97ea923 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

set string representation for Protein objects

parent 4f23f5f2
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,9 @@ class Protein(models.Model): ...@@ -104,6 +104,9 @@ class Protein(models.Model):
mol_function.save() mol_function.save()
self.molecular_functions.add(mol_function) self.molecular_functions.add(mol_function)
def __str__(self):
return '{} ({})'.format(self.uniprot_id, self.recommended_name_long)
class Domain(models.Model): class Domain(models.Model):
pfam_acc = models.CharField('Pfam Accession', max_length=10, unique=True) pfam_acc = models.CharField('Pfam Accession', max_length=10, unique=True)
pfam_id = models.CharField('Pfam Family Identifier', max_length=20) pfam_id = models.CharField('Pfam Family Identifier', max_length=20)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment