Commit 7143e9d0 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

set Protein recommended name and gene name fields as optional

fix #149
parent 5ffa6db7
Pipeline #17748 passed with stages
in 10 minutes and 42 seconds
# Generated by Django 2.2.1 on 2019-11-06 16:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0037_remove_compoundactivityresult_inhibition_percentage'),
]
operations = [
migrations.AlterField(
model_name='protein',
name='gene_name',
field=models.CharField(blank=True, max_length=30, null=True, verbose_name='Gene name'),
),
migrations.AlterField(
model_name='protein',
name='recommended_name_long',
field=models.CharField(blank=True, max_length=75, null=True, verbose_name='Uniprot Recommended Name (long)'),
),
]
......@@ -231,10 +231,10 @@ class Protein(AutoFillableModel):
uniprot_id = models.CharField("Uniprot ID", unique=True, max_length=10)
recommended_name_long = models.CharField(
"Uniprot Recommended Name (long)", max_length=75
"Uniprot Recommended Name (long)", max_length=75, blank=True, null=True
)
short_name = models.CharField("Short name", max_length=50)
gene_name = models.CharField("Gene name", max_length=30)
gene_name = models.CharField("Gene name", max_length=30, blank=True, null=True)
entry_name = models.CharField("Entry name", max_length=30)
organism = models.ForeignKey("Taxonomy", models.CASCADE)
molecular_functions = models.ManyToManyField(MolecularFunction)
......@@ -280,7 +280,7 @@ class Protein(AutoFillableModel):
self.domains.add(domain)
def is_autofill_done(self):
return len(self.gene_name) > 0
return len(self.entry_name) > 0
def __str__(self):
return "{} ({})".format(self.uniprot_id, self.recommended_name_long)
......
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