Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
1a815e2e
Commit
1a815e2e
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
improve SessionFormWizard gears for IPPI-DB contributions
Former-commit-id: a5fa539b34073de3c8df4e4137a04d3a4e33bdf6
parent
fce2cbad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ippisite/ippidb/forms.py
+4
-2
4 additions, 2 deletions
ippisite/ippidb/forms.py
ippisite/ippidb/views.py
+11
-1
11 additions, 1 deletion
ippisite/ippidb/views.py
with
15 additions
and
3 deletions
ippisite/ippidb/forms.py
+
4
−
2
View file @
1a815e2e
...
@@ -3,8 +3,10 @@ from django import forms
...
@@ -3,8 +3,10 @@ from django import forms
from
django.db
import
models
from
django.db
import
models
from
.models
import
Bibliography
,
Protein
,
ProteinDomainComplex
,
Ppi
,
PpiComplex
from
.models
import
Bibliography
,
Protein
,
ProteinDomainComplex
,
Ppi
,
PpiComplex
class
IdForm
(
forms
.
Form
):
class
IdForm
(
ModelForm
):
id
=
forms
.
CharField
(
label
=
""
,
max_length
=
100
,
widget
=
forms
.
TextInput
(
attrs
=
{
'
placeholder
'
:
'
PubMed ID / DOI / Patent ID
'
}))
class
Meta
:
model
=
Bibliography
fields
=
[
'
source
'
,
'
id_source
'
]
class
BibliographyForm
(
ModelForm
):
class
BibliographyForm
(
ModelForm
):
class
Meta
:
class
Meta
:
...
...
This diff is collapsed.
Click to expand it.
ippisite/ippidb/views.py
+
11
−
1
View file @
1a815e2e
...
@@ -57,7 +57,17 @@ TEMPLATES = {"IdForm": "IdForm.html",
...
@@ -57,7 +57,17 @@ TEMPLATES = {"IdForm": "IdForm.html",
class
IppiWizard
(
SessionWizardView
):
class
IppiWizard
(
SessionWizardView
):
def
get_template_names
(
self
):
def
get_template_names
(
self
):
return
[
TEMPLATES
[
self
.
steps
.
current
]]
return
[
TEMPLATES
[
self
.
steps
.
current
]]
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
"""
if
self
.
steps
.
current
==
'
IdForm
'
:
self
.
instance_dict
[
'
BibliographyForm
'
]
=
form
.
instance
return
self
.
get_form_step_data
(
form
)
def
done
(
self
,
form_list
,
**
kwargs
):
def
done
(
self
,
form_list
,
**
kwargs
):
return
render
(
self
.
request
,
'
/admin-session/add.html
'
,
{
return
render
(
self
.
request
,
'
/admin-session/add.html
'
,
{
'
form_data
'
:
[
form
.
cleaned_data
for
form
in
form_list
],
'
form_data
'
:
[
form
.
cleaned_data
for
form
in
form_list
],
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment