Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
1cc8b149
Commit
1cc8b149
authored
Mar 10, 2021
by
Fabien MAREUIL
Browse files
too many interactfiles, use filter and update
parent
358d16c6
Pipeline
#50441
failed with stages
in 25 minutes and 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
ippisite/ippidb/migrations/0068_auto_20210310_1052.py
View file @
1cc8b149
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment