Skip to content
Snippets Groups Projects
Commit 93bbdbf7 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

Hack instance_data in Wizard to enable non-queryset initial data

Former-commit-id: 9b734e59a7bbfa657c6f634e58ac50b90138d964
parent 690b534e
No related branches found
No related tags found
No related merge requests found
import ippidb import ippidb
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from formtools.wizard.views import SessionWizardView,NamedUrlSessionWizardView from formtools.wizard.views import SessionWizardView,NamedUrlSessionWizardView
...@@ -38,6 +39,9 @@ TEMPLATES = {"IdForm": "IdForm.html", ...@@ -38,6 +39,9 @@ TEMPLATES = {"IdForm": "IdForm.html",
"ProteinDomainComplexForm": "ProteinDomainComplexForm.html", "ProteinDomainComplexForm": "ProteinDomainComplexForm.html",
"PpiForm": "PpiForm.html"} "PpiForm": "PpiForm.html"}
class Ol(list):
ordered = True
class IppiWizard(NamedUrlSessionWizardView): class IppiWizard(NamedUrlSessionWizardView):
def get_template_names(self): def get_template_names(self):
return [TEMPLATES[self.steps.current]] return [TEMPLATES[self.steps.current]]
...@@ -62,8 +66,7 @@ class IppiWizard(NamedUrlSessionWizardView): ...@@ -62,8 +66,7 @@ class IppiWizard(NamedUrlSessionWizardView):
p.uniprot_id = uniprot_ids[0] p.uniprot_id = uniprot_ids[0]
p.autofill() p.autofill()
proteins.append(p) proteins.append(p)
#TODO replace p with proteins as the instance_dict self.instance_dict['ProteinForm'] = Ol(proteins)
self.instance_dict['ProteinForm'] = p
return self.get_form_step_data(form) return self.get_form_step_data(form)
def done(self, form_list, **kwargs): def done(self, form_list, **kwargs):
......
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