Commit ba5be5a5 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

retrieve info from NCBI for Taxonomy class

parent b8fc24ef
......@@ -52,6 +52,12 @@ class BibliographyForm(ModelForm):
class Taxonomy(models.Model):
taxonomy_id = models.DecimalField('NCBI TaxID', unique=True, max_digits=9, decimal_places=0)
name = models.CharField('Organism name', max_length=200)
def save(self, *args, **kwargs):
info = get_taxonomy_info(self.taxonomy_id)
self.name = info['scientific_name']
super(Taxonomy, self).save(*args, **kwargs)
class Meta:
verbose_name_plural = "taxonomies"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment