Commit 1cc8b149 authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

too many interactfiles, use filter and update

parent 358d16c6
Pipeline #50441 failed with stages
in 25 minutes and 18 seconds
...@@ -8,30 +8,25 @@ def init_isolevel(apps, schema_editor): ...@@ -8,30 +8,25 @@ def init_isolevel(apps, schema_editor):
InteractFile = apps.get_model("ippidb", "InteractFile") InteractFile = apps.get_model("ippidb", "InteractFile")
Chains = Chain.objects.all() Chains = Chain.objects.all()
if Chains: if Chains:
for Chain in Chains: Chain.update(default_isolevel=0.5)
Chain.default_isolevel = 0.5 InteractFiles = InteractFile.objects.filter(label="all")
Chain.save()
InteractFiles = InteractFile.objects.all()
if InteractFiles: if InteractFiles:
for InteractFile in InteractFiles: InteractFiles.update(default_isolevel=0.7)
if InteractFile.label == "all": InteractFiles = InteractFile.objects.filter(label="hydrophobic")
InteractFile.default_isolevel = 0.7 if InteractFiles:
InteractFile.save() InteractFiles.update(default_isolevel=0.3)
if InteractFile.label == "hydrophobic": InteractFiles = InteractFile.objects.filter(label="hbond donor-acceptor")
InteractFile.default_isolevel = 0.3 if InteractFiles:
InteractFile.save() InteractFiles.update(default_isolevel=0.3)
if InteractFile.label == "hbond donor-acceptor": InteractFiles = InteractFile.objects.filter(label="negative")
InteractFile.default_isolevel = 0.3 if InteractFiles:
InteractFile.save() InteractFiles.update(default_isolevel=0.08)
if InteractFile.label == "negative": InteractFiles = InteractFile.objects.filter(label="positive")
InteractFile.default_isolevel = 0.08 if InteractFiles:
InteractFile.save() InteractFiles.update(default_isolevel=0.05)
if InteractFile.label == "positive": InteractFiles = InteractFile.objects.filter(label="backbone")
InteractFile.default_isolevel = 0.05 if InteractFiles:
InteractFile.save() InteractFiles.update(default_isolevel=0.18)
if InteractFile.label == "backbone":
InteractFile.default_isolevel = 0.18
InteractFile.save()
class Migration(migrations.Migration): class Migration(migrations.Migration):
......
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