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
from django.shortcuts import render
from django.http import HttpResponseRedirect
from formtools.wizard.views import SessionWizardView,NamedUrlSessionWizardView
......@@ -38,6 +39,9 @@ TEMPLATES = {"IdForm": "IdForm.html",
"ProteinDomainComplexForm": "ProteinDomainComplexForm.html",
"PpiForm": "PpiForm.html"}
class Ol(list):
ordered = True
class IppiWizard(NamedUrlSessionWizardView):
def get_template_names(self):
return [TEMPLATES[self.steps.current]]
......@@ -62,8 +66,7 @@ class IppiWizard(NamedUrlSessionWizardView):
p.uniprot_id = uniprot_ids[0]
p.autofill()
proteins.append(p)
#TODO replace p with proteins as the instance_dict
self.instance_dict['ProteinForm'] = p
self.instance_dict['ProteinForm'] = Ol(proteins)
return self.get_form_step_data(form)
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