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

fix migration script

so that it uses the right verson of the model
parent 5b295e51
No related branches found
No related tags found
1 merge request!17Prepare v1.0.1
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
from ippidb.models import Compound, DrugBankCompound
def run_generate_drugbank_inchikey(apps, schema_editor): def run_generate_drugbank_inchikey(apps, schema_editor):
DrugBankCompound = apps.get_model("ippidb", "DrugBankCompound")
for drugbank_compound in DrugBankCompound.objects.all(): for drugbank_compound in DrugBankCompound.objects.all():
drugbank_compound.save(autofill=True) drugbank_compound.save(autofill=True)
def set_compound_drugbank_links(apps, schema_editor): def set_compound_drugbank_links(apps, schema_editor):
Compound = apps.get_model("ippidb", "Compound")
for compound in Compound.objects.all(): for compound in Compound.objects.all():
compound.set_drugbank_link() compound.set_drugbank_link()
compound.save() compound.save()
......
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