diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml index a3b0ca551af96feb6f1fa6f57741afe3c5268ed9..8e357c950cbc43a8c5ea2cd27e96b17c9891345d 100644 --- a/ansible/deploy.yaml +++ b/ansible/deploy.yaml @@ -92,11 +92,22 @@ app_path: "/home/{{ deploy_user_name }}/iPPIDB/ippisite" settings: "ippisite.{{ ansible_hostname }}_settings" # FIXME: this should obviously be removed before switching to prod. env. - - name: restrict access to the web server to specific IPs + - name: install passlib for htpasswd in ansible + yum: name=python-passlib state=installed + - file: + path: /etc/ippidb-80/passwdfile + state: absent + - htpasswd: + path: /etc/ippidb-80/passwdfile + name: ippidb + password: 'LeroyMerlin' #FIXME FIXME should be secret + owner: "{{ deploy_user_name }}" + mode: 0640 + - name: add httpd conf to use HTTP authentication lineinfile: dest=/etc/ippidb-80/httpd.conf regexp='' insertafter=EOF - line='<Location '/'>\nRequire all denied\nRequire ip 10.6.108.60\nRequire ip 10.6.107.22\nRequire ip 157.99\n</Location>\n' + line='LoadModule auth_basic_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_auth_basic.so'\nLoadModule authn_core_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authn_core.so'\nLoadModule authn_file_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authn_file.so'\nLoadModule authz_core_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authz_core.so'\nLoadModule authz_user_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authz_user.so'\n<Location />\nAuthType Basic\nAuthName "Restricted Files"\nAuthUserFile /etc/ippidb-80/passwdfile\nRequire valid-user\n</Location>\n' - name: copy systemd service file for IPPIDB-web copy: remote_src: true diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index fa85bfa572d801ee039e08c32f090375a42dddc5..0a313bde9ed71c6d3be16bc9bbee5bc7ac8542f0 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -90,8 +90,14 @@ class ProteinDomainComplexForm(ModelForm): fields=['protein', 'domain', 'ppc_copy_nb'] -ProteinDomainComplexFormSet = modelformset_factory(ProteinDomainComplex, fields=('protein', 'domain', 'ppc_copy_nb'), max_num=2) +class BaseProteinDomainComplexFormSet(BaseModelFormSet): + def __init__(self, *args, **kwargs): + super(BaseProteinDomainComplexFormSet,self).__init__(*args, **kwargs) + self.queryset = ProteinDomainComplex.objects.none() +ProteinDomainComplexFormSet = modelformset_factory(ProteinDomainComplex, form=ProteinDomainComplexForm, formset=BaseProteinDomainComplexFormSet, extra=2) +formset= ProteinDomainComplexFormSet() +#print(formset) class PpiForm(ModelForm): @@ -132,10 +138,13 @@ class BaseCompoundFormSet(BaseFormSet): super(BaseCompoundFormSet, self).add_fields(form, index) form.fields["compound_name"] = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Compound name in the publication', 'onkeyup':"AnEventHasOccurred(this.id)", 'required':'required'})) form.fields["molecule"] = forms.CharField(widget=forms.RadioSelect(choices=TYPE_MOLECULE, attrs={'onclick':"showMol(this.id)"})) - form.fields["molecule_comp"] = forms.CharField() + form.fields["molecule_comp"] = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Molecule commposition here', 'required':'required'})) -CompoundFormSet = formset_factory(CompoundForm, formset=BaseCompoundFormSet) +CompoundFormSet = formset_factory(CompoundForm, formset=BaseCompoundFormSet, extra=2, max_num=500, can_delete=True) formset = CompoundFormSet() +print(formset.is_valid()) +for form in formset: + print(form.as_table()) class TestsForm(ModelForm): diff --git a/ippisite/ippidb/static/js/ippidb.js b/ippisite/ippidb/static/js/ippidb.js index f8827b243bad216e7c46f04f97963ee7785d8d74..ab49dfd1ed1dc29cba393de0a9bfb0eae590877a 100644 --- a/ippisite/ippidb/static/js/ippidb.js +++ b/ippisite/ippidb/static/js/ippidb.js @@ -25,41 +25,6 @@ function AnEventHasOccurred(id) { document.getElementById("Name_"+id).innerHTML = "Compound "+ document.getElementById(id).value; } -// CompoundForm - Function to hide/show input field according to the chosen type of molecule -function showMol(id){ - var newID=id.slice(0, -1); - console.log("Test "+newID); - if(document.getElementById(id).value=="smiles"){ - document.getElementById('divSmiles_'+newID+'0').style.display ='block'; - document.getElementById('divIupac_'+newID+'0').style.display ='none'; - document.getElementById('divSketch_'+newID+'0').style.display ='none'; - document.getElementById('in-smiles_'+newID+'0').required=true; - document.getElementById('in-sketch_'+newID+'0').required=false; - document.getElementById('in-iupac_'+newID+'0').required=false; - } else if(document.getElementById(id).value=="iupac"){ - document.getElementById('divSmiles_'+newID+'0').style.display ='none'; - document.getElementById('divIupac_'+newID+'0').style.display ='block'; - document.getElementById('divSketch_'+newID+'0').style.display ='none'; - document.getElementById('in-smiles_'+newID+'0').required=false; - document.getElementById('in-iupac_'+newID+'0').required=true; - document.getElementById('in-sketch_'+newID+'0').required=false; - } else if (document.getElementById(id).value=="sketch"){ - document.getElementById('divSmiles_'+newID+'0').style.display ='none'; - document.getElementById('divIupac_'+newID+'0').style.display ='none'; - document.getElementById('divSketch_'+newID+'0').style.display ='block'; - document.getElementById('in-smiles_'+newID+'0').required=false; - document.getElementById('in-iupac_'+newID+'0').required=false; - document.getElementById('in-sketch_'+newID+'0').required=true; - } else { - document.getElementById('divSmiles_'+newID+'0').style.display ='none'; - document.getElementById('divIupac_'+newID+'0').style.display ='none'; - document.getElementById('divSketch_'+newID+'0').style.display ='none'; - document.getElementById('in-smiles_'+newID+'0').required=false; - document.getElementById('in-iupac_'+newID+'0').required=false; - document.getElementById('in-sketch_'+newID+'0').required=false; - } -} - // Function to add/remove form in CoumpoundFormSet function addComp(id){ var div = document.getElementById("compound_"+id); diff --git a/ippisite/ippidb/templates/CompoundForm.html b/ippisite/ippidb/templates/CompoundForm.html index a771a3df1538fa8f99c22875e0ce747ac45c3709..418ed37be25e18709468dd723a4df1760ea2d5aa 100644 --- a/ippisite/ippidb/templates/CompoundForm.html +++ b/ippisite/ippidb/templates/CompoundForm.html @@ -25,10 +25,12 @@ {% csrf_token %} <table> {{ wizard.form.errors}} - {{ wizard.form.non_field_errors}} + {{ wizard.form.non_field_errors}} {% if wizard.form.forms %} + {{ wizard.form.management_form }} + <div class="compound"> {% for form in wizard.form.forms %} - <div class="compound"> + {% if forloop.first %} <div id="compound_{{ form.compound_name.id_for_label }}"> <h1 id="Name_{{ form.compound_name.id_for_label }}">Compound</h1> <h2>Name your compound</h2> @@ -45,31 +47,51 @@ </div> {% endfor %} </div> - <div id="divSmiles_{{ form.molecule.id_for_label }}"> - <input type="text" name="smiles" id="in-smiles_{{ form.compound_name.id_for_label }}" placeholder="Paste the SMILES of your molecule here" required> + <div id="molecule_comp_{{ form.molecule.id_for_label }}"> + {{form.molecule_comp}} </div> - <div id="divIupac_{{ form.molecule.id_for_label }}" class="hide"> - <input type="text" name="iupac" id="in-iupac_{{ form.compound_name.id_for_label }}" placeholder="Paste the IUPAC of your molecule here"> + <div id="ck-button-long" class="compound_input"> + <label>{{ form.is_macrocycle}}<span>{{ form.is_macrocycle.label }}</span></label> </div> - <div id="divSketch_{{ form.molecule.id_for_label }}" class="hide"> - <input type="text" name="sketch" id="in-sketch_{{ form.compound_name.id_for_label }}" placeholder="Sketch your molecule here"> + </div> + {% else %} + <div id="compound_{{ form.compound_name.id_for_label }}"> + <h1 id="Name_{{ form.compound_name.id_for_label }}">Compound</h1> + <h2>Name your compound</h2> + <div class="compound_input">{{ form.common_name }}</div> + <div class="compound_input">{{ form.compound_name }}</div> + <h2>Choose a format to import your molecule</h2> + <div id="compound_mol"> + {% for radio in form.molecule %} + <div class="compound_radio_{{ radio.choice_label }}"> + {{ radio.tag }} + <label for="{{ radio.id_for_label }}"> + <span>{{ radio.choice_label }}</span> + </label> + </div> + {% endfor %} + </div> + <div id="molecule_comp_{{ form.molecule.id_for_label }}"> + {{form.molecule_comp}} </div> <div id="ck-button-long" class="compound_input"> <label>{{ form.is_macrocycle}}<span>{{ form.is_macrocycle.label }}</span></label> </div> </div> - <div class="add_form"> - <div id="{{ form.compound_name.id_for_label }}" onclick="addComp(this.id)">Add compound<div> + <div id="ck-button-long" class="compound_input"> + <label>{{ form.DELETE}}<span>Remove compound</span></label> </div> - </div> + {% endif %} {% endfor %} - + </div> + <!--<div class="add_form"> + <div id="{{ form.compound_name.id_for_label }}" onclick="">Add compound<div> + </div>--> {% endif %} + <input type="hidden" name="ippi_wizard-current_step" value="CompoundForm" id="id_ippi_wizard-current_step"/> </table> - <div> <input type="submit" value="{% trans "Next step" %}"/> <a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a> - </div> </form> </div> </div> diff --git a/ippisite/ippidb/templates/PpiForm.html b/ippisite/ippidb/templates/PpiForm.html index 1ca7318031c20662d900acc54cd784b90753ff5a..901283dbd3ae63a44858395745f74b6fcdd3ca77 100644 --- a/ippisite/ippidb/templates/PpiForm.html +++ b/ippisite/ippidb/templates/PpiForm.html @@ -31,14 +31,11 @@ {% block custom_form %}{% endblock %} {% if wizard.form.forms %} - {{ wizard.form.management_form }} {% for form in wizard.form.forms %} {{ form }} {% endfor %} {% else %} <div class="inline_box_complex"> - {{PpiComplexForm}} - {{PpiForm}} <div class="inline_label"> PPI: </div> <div>{{ wizard.form.pdb_id }}</div> <div class="inline_field">{{ wizard.form.cc_nb }}</div> diff --git a/ippisite/ippidb/templates/ProteinDomainComplexForm.html b/ippisite/ippidb/templates/ProteinDomainComplexForm.html index 8299ca283da521205dd06fae475a441101da1110..c416505e2f1ea7f34d1b5f2b0a44f5e997ff6c57 100644 --- a/ippisite/ippidb/templates/ProteinDomainComplexForm.html +++ b/ippisite/ippidb/templates/ProteinDomainComplexForm.html @@ -26,27 +26,29 @@ <div class="form_div"> <form action="" method="post"> {% csrf_token %} - {{ wizard.form.errors}} - {{ wizard.form.non_field_errors}} + <table> {{ wizard.management_form }} - {{ ProteinDomainComplexFormSet.management_form }} + {{ wizard.form.non_field_errors}} {% if wizard.form.forms %} - <table> - <div class="inline_box_complex"> - <div class="inline_label"> Bound complex : </div> + {{ wizard.form.management_form }} + {% for form in wizard.form.forms %} + {% if forloop.first %} + <div class="inline_box_complex"> + <div class="inline_label">Bound + {% else %} + <div class="inline_box_complex"> + <div class="inline_label">Partner + {% endif %} + complex : </div> <div class="inline_field"> {{ form.protein }}</div> - <div class="inline_field"> {{ form.domain }}</div> - <div class="inline_field"><div>{{ form.ppc_copy_nb }}</div></div> - </div> - <div class="inline_box_complex"> - <div class="inline_label"> Partner complex : </div> - <div class="inline_field"> {{ form.protein }}</div> - <div class="inline_field"> {{ form.domain }}</div> + <div class="inline_field"> {{ form.domain }}</div> <div class="inline_field"><div>{{ form.ppc_copy_nb }}</div></div> - </div> - </table> + </div> + {% endfor %} {% endif %} - <input type="submit" value="{% trans "Next step" %}"/> + <input type="hidden" name="ippi_wizard-current_step" value="ProteinDomainComplexForm" id="id_ippi_wizard-current_step"/> + </table> + <input type="submit" name="{{ wizard.steps.next }}" value="{% trans "Next step" %}"/> <a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a> </form> </div> diff --git a/ippisite/ippidb/templates/add.html b/ippisite/ippidb/templates/add.html index c6357a68af95bc2dd7c7e5b28ba9db149f9b6c0f..6f2409e103a5ca4f72bf92e1655209edf94c9561 100644 --- a/ippisite/ippidb/templates/add.html +++ b/ippisite/ippidb/templates/add.html @@ -25,7 +25,7 @@ <nav class="breadcrumb" role="navigation"> <div id="breadcrumb-label" class="breadcrumb-label">You are here</div> <div aria-labelledby="breadcrumb-label"> - {% block breadcrumb %} {{block.super}} > Add New Content{% endblock %} + {% block breadcrumb %} {{block.super}} > <a href="/admin-session/add/IdForm"> Add New Content </a>{% endblock %} </div> </nav> <div id="main-wrapper" class="page"> diff --git a/ippisite/ippidb/templates/admin-session.html b/ippisite/ippidb/templates/admin-session.html index 5a96ed40529e78e867fdb80db1219a5cc8cc91a3..ba96a0ad4110c58adb8aa8de12c57742c932072d 100644 --- a/ippisite/ippidb/templates/admin-session.html +++ b/ippisite/ippidb/templates/admin-session.html @@ -9,7 +9,7 @@ <div class="inner-wrap"> <ul> <li> - <a href="/compound/">View Content</a> + <a href="">View Content</a> </li> <li> <a href="/admin-session/add/IdForm">Add New Content</a> diff --git a/ippisite/ippidb/templates/base.html b/ippisite/ippidb/templates/base.html index d4d687e68a882ef6fcfdaf8af82613cf9b301440..44dc09868c7e346a3242c29fea0bcdfdf924d656 100644 --- a/ippisite/ippidb/templates/base.html +++ b/ippisite/ippidb/templates/base.html @@ -45,7 +45,7 @@ <a href="/about">About</a> </li> <li> - <a href="/query">Query</a> + <a href="/queries">Queries</a> </li> <li> <a href="/tutorials">Tutorials</a> diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html index dd499185feacf3bf6b9d173728d2227184f23e60..2e8308a600b75e5af2ee3ed186f7e83c12896a45 100644 --- a/ippisite/ippidb/templates/compound_list.html +++ b/ippisite/ippidb/templates/compound_list.html @@ -1,21 +1,18 @@ -{% extends "admin-session.html" %} +{% extends "queries.html" %} {% load customtags %} {% block title %}compounds list{% endblock %} {% block content %} <div id="mainnav"> - <nav class="secondary-nav"> + <nav class="secondary-nav"> <div class="inner-wrap"> <ul> - <li> - <a href="/compound/">View Content</a> - </li> <li> - <a href="/admin-session/add/IdForm">Add New Content</a> + <a href="/compound">By Compounds</a> </li> <li> - <a href="/admin-session/update">Update Content</a> + <a href="/queries/pockets">By Pockets</a> </li> </ul> </div> @@ -25,7 +22,7 @@ <nav class="breadcrumb" role="navigation"> <div id="breadcrumb-label" class="breadcrumb-label">You are here</div> <div aria-labelledby="breadcrumb-label"> - {% block breadcrumb %} {{block.super}}> <a href="/compound/">View content</a>{% endblock %} + {% block breadcrumb %} {{block.super}}> <a href="/compound/">By compounds</a>{% endblock %} </div> </nav> </div> diff --git a/ippisite/ippidb/templates/pharma.html b/ippisite/ippidb/templates/pharma.html index 24647d8bfdd0b02474289f0d5822cde811d65bed..e2eef6e8e3b5f33abc44294aa77d3bda7b07f9b0 100644 --- a/ippisite/ippidb/templates/pharma.html +++ b/ippisite/ippidb/templates/pharma.html @@ -9,10 +9,10 @@ <div class="inner-wrap"> <ul> <li> - <a href="/query/pharma">By pharmacological criteria</a> + <a href="/compound">By Compounds</a> </li> <li> - <a href="/query/chemical">By chemical similarity</a> + <a href="/query/pockets">By Pockets</a> </li> </ul> </div> diff --git a/ippisite/ippidb/templates/chemical.html b/ippisite/ippidb/templates/pockets.html similarity index 82% rename from ippisite/ippidb/templates/chemical.html rename to ippisite/ippidb/templates/pockets.html index c2f4db08fbf2ef4fdae58752ee61eec5fa2c9f7b..0bb9fbecf95479e30fb94a78bb27566b6862cd87 100644 --- a/ippisite/ippidb/templates/chemical.html +++ b/ippisite/ippidb/templates/pockets.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "queries.html" %} {% block title %}inhibitors of Protein-Protein Interaction Database{% endblock %} @@ -9,10 +9,10 @@ <div class="inner-wrap"> <ul> <li> - <a href="/query/pharma">By pharmacological criteria</a> + <a href="/compound">By Compounds</a> </li> <li> - <a href="/query/chemical">By chemical similarity</a> + <a href="/queries/pockets">By Pockets</a> </li> </ul> </div> @@ -22,7 +22,7 @@ <nav class="breadcrumb" role="navigation"> <div id="breadcrumb-label" class="breadcrumb-label">You are here</div> <div aria-labelledby="breadcrumb-label"> - Fonction Fil d'Arianne + {% block breadcrumb %} {{block.super}}> <a href="/pockets/">By Pockets</a>{% endblock %} </div> </nav> <div id="main-wrapper" class="page"> @@ -30,7 +30,7 @@ <div id="content" class="main-content"> <div class="section"> <main role="main"> - <h1 class="page-title"> BY CHEMICAL SIMILARITY </h1> + <h1 class="page-title"> BY POCKETS </h1> <div class="tabs"></div> <div class="main__inner"> <div class="region region-content"> diff --git a/ippisite/ippidb/templates/query.html b/ippisite/ippidb/templates/queries.html similarity index 85% rename from ippisite/ippidb/templates/query.html rename to ippisite/ippidb/templates/queries.html index 01e0e5f93123ba708866ebcc38c60611ca0f5c9e..b78b4ec52afbc47b45f677778b0da4ad0b9d1504 100644 --- a/ippisite/ippidb/templates/query.html +++ b/ippisite/ippidb/templates/queries.html @@ -5,14 +5,14 @@ {% block content %} <div id="mainnav"> - <nav class="secondary-nav"> + <nav class="secondary-nav"> <div class="inner-wrap"> <ul> <li> - <a href="/query/pharma">By pharmacological criteria</a> + <a href="/compound">By Compounds</a> </li> <li> - <a href="/query/chemical">By chemical similarity</a> + <a href="/queries/pockets">By Pockets</a> </li> </ul> </div> @@ -22,7 +22,7 @@ <nav class="breadcrumb" role="navigation"> <div id="breadcrumb-label" class="breadcrumb-label">You are here</div> <div aria-labelledby="breadcrumb-label"> - Fonction Fil d'Arianne + {% block breadcrumb %} {{block.super}} Queries {% endblock %} </div> </nav> <div id="main-wrapper" class="page"> diff --git a/ippisite/ippidb/urls.py b/ippisite/ippidb/urls.py index 22560cc734eac2986552cf27df0e366238a6a554..a7aa1f587541cbe0542a26d38b966e794e16f40d 100644 --- a/ippisite/ippidb/urls.py +++ b/ippisite/ippidb/urls.py @@ -1,6 +1,6 @@ from django.conf.urls import include, url from . import views -from ippidb.forms import IdForm,BibliographyForm, PDBForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, ProteinDomainComplexFormSet,PpiForm, PpiComplexForm, ProteinFormSet,TestsForm, CompoundForm, CompoundFormSet +from ippidb.forms import * from ippidb.views import IppiWizard, FORMS ippidb_wizard = IppiWizard.as_view(FORMS, @@ -16,9 +16,8 @@ urlpatterns = [ views.physicochemistry, name='physicochemistry'), url(r'^about/drug-candidate/$', views.drugCandidate, name='drug-candidate'), - url(r'^query$', views.query, name='query'), - url(r'^query/pharma/$', views.pharma, name='pharma'), - url(r'^query/chemical/$', views.chemical, name='chemical'), + url(r'^queries$', views.queries, name='queries'), + url(r'^queries/pockets/$', views.pockets, name='pockets'), url(r'^biblio/(?P<source>\w{2})(?P<id_source>\w+)$', views.biblio_card, name='biblio_card'), url(r'^biblio/$', views.biblio_list, name='biblio_list'), url(r'^compound/$', views.compound_list, name='compound_list'), diff --git a/ippisite/ippidb/views.py b/ippisite/ippidb/views.py index 7d1f5095243e7ddc95cb59e597f284936090e00c..e06ba57612e474cca1082bdb603101d8604e3f19 100644 --- a/ippisite/ippidb/views.py +++ b/ippisite/ippidb/views.py @@ -32,16 +32,16 @@ def drugCandidate(request): return render(request, 'drug-candidate.html') -def query(request): - return render(request, 'query.html') +def queries(request): + return render(request, 'queries.html') -def pharma(request): - return render(request, 'pharma.html') +def compounds(request): + return render(request, 'compound.html') -def chemical(request): - return render(request, 'chemical.html') +def pockets(request): + return render(request, 'pockets.html') def tutorials(request): @@ -73,7 +73,7 @@ TEMPLATES = {"IdForm": "IdForm.html", class IppiWizard(NamedUrlSessionWizardView): - + def get_context_data(self, **kwargs): context=super(IppiWizard, self).get_context_data(**kwargs) if self.steps.current == 'BibliographyForm': @@ -87,36 +87,15 @@ class IppiWizard(NamedUrlSessionWizardView): if self.steps.current == 'PpiForm': context['complex_choice']=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexChoice') context['complex_type']=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexType') - context['pdb_id']=self.storage.get_step_data('PDBForm').get('PDBForm-pdb_id') + context['pdb']=self.storage.get_step_data('PDBForm').get('PDBForm-pdb_id') return context def get_form_initial(self, step): initial = {} - # Pre-fill fields with data from a previous form if step == 'ProteinDomainComplexForm': - complex_type=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexType') - complex_choice=self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexChoice') - if complex_type == "Hetero2merAB" and complex_choice == "inhibited": - initial['ppc_copy_nb'] = 1 - elif complex_type == "Homo2merA2" and complex_choice == "inhibited": - initial['ppc_copy_nb'] = 1 - elif complex_type == "Hetero2merAB" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 1 - elif complex_type == "Homo2merA2" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 2 - elif complex_type == "HomoLike2mer" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 2 - elif complex_type == "Homo3merA3" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 3 - elif complex_type == "Homo3merA2" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 2 - elif complex_type == "Homo4merA4" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 4 - elif complex_type == "RingHomo3mer" and complex_choice == "stabilized": - nitial['ppc_copy_nb'] = 3 - elif complex_type == "RingHomo5mer" and complex_choice == "stabilized": - initial['ppc_copy_nb'] = 5 + pks = self.storage.get_step_data('PDBForm').get('pks') + print("Proteins",Protein.objects.filter(id__in=pks)) if step == 'PpiForm': initial['pdb_id'] = self.storage.get_step_data('PDBForm').get('PDBForm-pdb_id') return self.initial_dict.get(step, initial) @@ -148,7 +127,7 @@ class IppiWizard(NamedUrlSessionWizardView): p.save() protein_ids.append(p.id) data['pks'] = protein_ids - print(data) + print("test",data) return data def get_form_instance(self, step):