Commit e5f16122 authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

memory free update

parent 8cc83aaf
Pipeline #50460 passed with stages
in 22 minutes and 56 seconds
......@@ -6,40 +6,16 @@ from django.db import migrations, models
def init_isolevel(apps, schema_editor):
Chain = apps.get_model("ippidb", "Chain")
InteractFile = apps.get_model("ippidb", "InteractFile")
Chains = Chain.objects.all()
if Chains:
Chains.update(default_isolevel=0.5)
Chains = Chain.objects.none()
InteractFiles = InteractFile.objects.filter(label="all")
if InteractFiles:
InteractFiles.update(default_isolevel=0.7)
InteractFiles = InteractFile.objects.none()
InteractFiles = InteractFile.objects.filter(label="hydrophobic")
if InteractFiles:
InteractFiles.update(default_isolevel=0.3)
InteractFiles = InteractFile.objects.none()
InteractFiles = InteractFile.objects.filter(label="hbond donor-acceptor")
if InteractFiles:
InteractFiles.update(default_isolevel=0.3)
InteractFiles = InteractFile.objects.none()
InteractFiles = InteractFile.objects.filter(label="negative")
if InteractFiles:
InteractFiles.update(default_isolevel=0.08)
InteractFiles = InteractFile.objects.none()
InteractFiles = InteractFile.objects.filter(label="positive")
if InteractFiles:
InteractFiles.update(default_isolevel=0.05)
InteractFiles = InteractFile.objects.none()
InteractFiles = InteractFile.objects.filter(label="backbone")
if InteractFiles:
InteractFiles.update(default_isolevel=0.18)
InteractFiles = InteractFile.objects.none()
Chain.objects.all().update(default_isolevel=0.5)
InteractFile.objects.filter(label="all").update(default_isolevel=0.7)
InteractFile.objects.filter(label="hydrophobic").update(default_isolevel=0.3)
InteractFile.objects.filter(label="hbond donor-acceptor").update(
default_isolevel=0.3
)
InteractFile.objects.filter(label="negative").update(default_isolevel=0.08)
InteractFile.objects.filter(label="positive").update(default_isolevel=0.05)
InteractFile.objects.filter(label="backbone").update(default_isolevel=0.18)
class Migration(migrations.Migration):
......
Markdown is supported
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