Skip to content
Snippets Groups Projects
Commit cf9c2ee3 authored by Rachel TORCHET's avatar Rachel TORCHET
Browse files

save data to pass between ProteinDomainComplex(Type)Form in wizard

Former-commit-id: f021cb531522fc7aa44570beefaaa81d906271a3
parent 267e2157
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ from django.http import HttpResponseRedirect
from formtools.wizard.views import SessionWizardView,NamedUrlSessionWizardView
from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, ProteinFormSet, PDBFormSet
from .models import Protein, Bibliography
from .models import Protein, Bibliography, ProteinDomainComplex
from .ws import get_pdb_uniprot_mapping
def index(request):
......@@ -68,6 +68,9 @@ class IppiWizard(NamedUrlSessionWizardView):
if self.steps.current=='ProteinForm':
pks = self.storage.get_step_data('PDBForm').get('pks')
return Protein.objects.filter(id__in=pks)
if self.steps.current=='ProteinDomainComplexForm':
complexType = self.storage.get_step_data('ProteinDomainComplexTypeForm').get('complexType')
return ProteinDomainComplex.objects.get(complexType=complexType)
def process_step(self, form):
"""
......@@ -97,6 +100,8 @@ class IppiWizard(NamedUrlSessionWizardView):
p.save()
protein_ids.append(p.id)
data['pks'] = protein_ids
if self.steps.current=='ProteinDomainComplexTypeForm':
data['complex_type']=form['complexType']
return data
def done(self, form_list, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment