diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py index d2d8ddfc601472d70ff485072de37fc00e58da74..1a683e636d68d4a0e0b83f510062cbf5121847b1 100644 --- a/ippisite/ippidb/models.py +++ b/ippisite/ippidb/models.py @@ -18,7 +18,9 @@ class AutoFillableModel(models.Model): def save(self, *args, **kwargs): if kwargs.get('autofill') is True: self.autofill() - super(AutoFillableModel, self).save(*args, **kwargs) + if 'autofill' in kwargs: + del kwargs['autofill'] + super(AutoFillableModel, self).save(*args, *kwargs) class Bibliography(AutoFillableModel): @@ -30,7 +32,7 @@ class Bibliography(AutoFillableModel): ('PT', 'Patent'), ('DO', 'DOI ID') ) - source = models.CharField('Bibliographic type', max_length=2, choices=SOURCES) + source = models.CharField('Bibliographic type', max_length=2, choices=SOURCES, default='PM') id_source = models.CharField('Bibliographic ID', max_length=25) title = models.CharField('Title', max_length=300) journal_name = models.CharField('Journal name', max_length=50, null=True) @@ -107,7 +109,8 @@ class Protein(AutoFillableModel): taxonomy.taxonomy_id = info['organism'] taxonomy.save(autofill=True) self.organism = taxonomy - #super(Protein, self).save(*args, **kwargs) + print(self, self.gene_name) + super(Protein, self).save() for go_id in info['molecular_functions']: try: mol_function = MolecularFunction.objects.get(go_id=go_id)