Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
c537ae6f
Commit
c537ae6f
authored
7 years ago
by
Rachel TORCHET
Browse files
Options
Downloads
Patches
Plain Diff
Update views.py
Former-commit-id: f4067dda556067ae1ac78af600b05263ce9f9030
parent
bf6e8f72
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/views.py
+40
-1
40 additions, 1 deletion
ippisite/ippidb/views.py
with
40 additions
and
1 deletion
ippisite/ippidb/views.py
+
40
−
1
View file @
c537ae6f
...
@@ -89,7 +89,46 @@ class IppiWizard(NamedUrlSessionWizardView):
...
@@ -89,7 +89,46 @@ class IppiWizard(NamedUrlSessionWizardView):
initial
[
'
pdb_id
'
]
=
self
.
storage
.
get_step_data
(
'
PDBForm
'
).
get
(
'
PDBForm-pdb_id
'
)
initial
[
'
pdb_id
'
]
=
self
.
storage
.
get_step_data
(
'
PDBForm
'
).
get
(
'
PDBForm-pdb_id
'
)
return
self
.
initial_dict
.
get
(
step
,
initial
)
return
self
.
initial_dict
.
get
(
step
,
initial
)
def
process_step
(
self
,
form
):
"""
This method overrides the one used to postprocess the form data.
The added code just sets the form model for use in later forms
when appropriate
"""
data
=
super
(
IppiWizard
,
self
).
process_step
(
form
).
copy
()
if
self
.
steps
.
current
==
'
Bibliography
'
:
form
.
instance
.
autofill
()
if
self
.
steps
.
current
==
'
Bibliography
'
:
form
.
instance
.
save
()
data
[
'
pk
'
]
=
form
.
instance
.
id
if
self
.
steps
.
current
==
'
PDBForm
'
:
pdb_ids
=
[
form
[
'
pdb_id
'
]
for
form
in
form
.
cleaned_data
]
uniprot_ids
=
[]
protein_ids
=
[]
for
pdb_id
in
pdb_ids
:
uniprot_ids
+=
get_pdb_uniprot_mapping
(
pdb_id
)
for
uniprot_id
in
uniprot_ids
:
try
:
p
=
Protein
.
objects
.
get
(
uniprot_id
=
uniprot_id
)
except
Protein
.
DoesNotExist
:
p
=
Protein
()
p
.
uniprot_id
=
uniprot_ids
[
0
]
p
.
autofill
()
p
.
save
()
protein_ids
.
append
(
p
.
id
)
data
[
'
pks
'
]
=
protein_ids
return
data
def
get_form_instance
(
self
,
step
):
if
self
.
steps
.
current
==
'
PDBForm
'
:
pk
=
self
.
storage
.
get_step_data
(
'
BibliographyForm
'
).
get
(
'
pk
'
)
return
Bibliography
.
objects
.
get
(
pk
=
pk
)
if
self
.
steps
.
current
==
'
ProteinForm
'
:
pks
=
self
.
storage
.
get_step_data
(
'
PDBForm
'
).
get
(
'
pks
'
)
print
(
Protein
.
objects
.
filter
(
id__in
=
pks
))
return
Protein
.
objects
.
filter
(
id__in
=
pks
)
def
get_template_names
(
self
):
def
get_template_names
(
self
):
return
[
TEMPLATES
[
self
.
steps
.
current
]]
return
[
TEMPLATES
[
self
.
steps
.
current
]]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment