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):
InteractFile = apps.get_model("ippidb", "InteractFile")
Chains = Chain.objects.all()
if Chains:
for Chain in Chains:
Chain.default_isolevel = 0.5
Chain.save()
InteractFiles = InteractFile.objects.all()
Chain.update(default_isolevel=0.5)
InteractFiles = InteractFile.objects.filter(label="all")
if InteractFiles:
for InteractFile in InteractFiles:
if InteractFile.label == "all":
InteractFile.default_isolevel = 0.7
InteractFile.save()
if InteractFile.label == "hydrophobic":
InteractFile.default_isolevel = 0.3
InteractFile.save()
if InteractFile.label == "hbond donor-acceptor":
InteractFile.default_isolevel = 0.3
InteractFile.save()
if InteractFile.label == "negative":
InteractFile.default_isolevel = 0.08
InteractFile.save()
if InteractFile.label == "positive":
InteractFile.default_isolevel = 0.05
InteractFile.save()
if InteractFile.label == "backbone":
InteractFile.default_isolevel = 0.18
InteractFile.save()
InteractFiles.update(default_isolevel=0.7)
InteractFiles = InteractFile.objects.filter(label="hydrophobic")
if InteractFiles:
InteractFiles.update(default_isolevel=0.3)
InteractFiles = InteractFile.objects.filter(label="hbond donor-acceptor")
if InteractFiles:
InteractFiles.update(default_isolevel=0.3)
InteractFiles = InteractFile.objects.filter(label="negative")
if InteractFiles:
InteractFiles.update(default_isolevel=0.08)
InteractFiles = InteractFile.objects.filter(label="positive")
if InteractFiles:
InteractFiles.update(default_isolevel=0.05)
InteractFiles = InteractFile.objects.filter(label="backbone")
if InteractFiles:
InteractFiles.update(default_isolevel=0.18)
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