Skip to content
Snippets Groups Projects
Commit 7a990de8 authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

Merge branch 'master' of https://gitlab.pasteur.fr/hub/iPPIDB

Former-commit-id: c2983bb7b11d9a934d5c8766084ab36cda0aea7e
parents ba3d7a8f a915c6f9
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 32 deletions
ippisite/database_model.png

499 KiB

......@@ -102,17 +102,13 @@ class ComplexCompositionForm(forms.Form):
def __init__(self,*args,**kwargs):
super(ComplexCompositionForm, self).__init__(*args, **kwargs)
""" TODO : Filter based on submited PDBid"""
self.fields['complex_protein'].queryset=Protein.objects.filter(pk__in=[569,570])
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)
ComplexCompositionFormSet = formset_factory(ComplexCompositionForm, extra=2)
formset= ComplexCompositionFormSet()
print(formset.is_valid())
class PpiForm(ModelForm):
......@@ -154,7 +150,7 @@ class BaseCompoundFormSet(BaseFormSet):
form.fields["molecule"] = forms.CharField(widget=forms.Select(choices=TYPE_MOLECULE))
form.fields["molecule_comp"] = forms.CharField(widget=forms.TextInput(attrs={'placeholder':'Molecule composition', 'required':'required'}))
CompoundFormSet = formset_factory(CompoundForm, formset=BaseCompoundFormSet, extra=2, max_num=500, can_delete=True)
CompoundFormSet = formset_factory(CompoundForm, formset=BaseCompoundFormSet, max_num=500, can_delete=True)
formset = CompoundFormSet()
......
......@@ -13,6 +13,9 @@ Description: IPPI-DB Theme
.clear_all{
font-size: 14px;
color: #007bff;
text-decoration: none;
font-family: "BrandonGrotesqueReg"
}
#main-header{
......@@ -616,7 +619,6 @@ font-size: 42px;
padding: 10px;
min-height: 150px;
text-align: center;
min-height: 350px;
border-top: 1px solid #2D96FA;
}
......
......@@ -80,7 +80,6 @@
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</form>
</div>
</div>
......
......@@ -60,7 +60,7 @@
</div>
</div>
{% endfor %}
</div>
</div>
<!--<div class="add_form">
<div id="{{ form.compound_name.id_for_label }}" onclick="">Add compound<div>
</div>-->
......@@ -68,7 +68,6 @@
<input type="hidden" name="ippi_wizard-current_step" value="CompoundForm" id="id_ippi_wizard-current_step"/>
</table>
<input type="submit" value="{% trans "Next step" %}"/>
<a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a>
</form>
</div>
</div>
......
......@@ -51,7 +51,6 @@
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "Get Infos" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</form>
</div>
</div>
......
......@@ -40,7 +40,6 @@
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</form>
</div>
</div>
......
......@@ -45,11 +45,9 @@
</div>
{% endif %}
</table>
<input type="hidden" name="ippi_wizard-current_step" value="PpiAndPpiComplexForm" id="id_ippi_wizard-current_step"/>
<input type="hidden" name="ippi_wizard-current_step" value="PpiForm" id="id_ippi_wizard-current_step"/>
<input class="submit_button" type="submit" name="{{ wizard.steps.next }}" value="{% trans "Next step" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</form>
<div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -28,23 +28,22 @@
<form action="" method="post">
{% csrf_token %}
<table>
{{ wizard.management_form }}
{{ wizard.form.non_field_errors}}
{{ wizard.form.errors}}
{{ wizard.form.non_field_errors}}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
{% for form in wizard.form.forms %}
{% endfor %}
{% else %}
<div class="inline_box_complex_long">
<div class="input_field"> {{ form.complex_type }}</div>
<div class="input_field"> {{ form.complex_protein }}</div>
<div class="input_field"> {{ form.complex_domain }}</div>
<div class="input_field"> {{ form.ppc_copy_nb }}</div>
</div>
{% endfor %}
{% endif %}
<input type="hidden" name="ippi_wizard-current_step" value="ProteinDomainComplexForm" id="id_ippi_wizard-current_step"/>
</table>
<input type="hidden" name="ippi_wizard-current_step" value="ProteinDomainComplexForm" id="id_ippi_wizard-current_step"/>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
</form>
</div>
</div>
......
......@@ -90,8 +90,8 @@ If your PPI complex is not among them, please select « Custom »</p>
</div>
{% endif %}
</table>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
<input type="hidden" name="ippi_wizard-current_step" value="ProteinDomainComplexTypeForm" id="id_ippi_wizard-current_step"/>
<input class="submit_button" type="submit" value="{% trans "Next step" %}"/>
</form>
</div>
</div>
......
......@@ -41,7 +41,6 @@
{% endif %}
</table>
<input type="submit" value="{% trans "submit" %}"/>
<a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a>
</form>
</div>
</div>
......
......@@ -57,6 +57,7 @@
{% block form %}{% endblock %}
</div>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</div>
</div>
</div>
......
......@@ -46,8 +46,6 @@
<div class="view-content">
</div>
<input class="submit_button" type="submit" name="{{ wizard.steps.next }}" value="{% trans "Next step" %}"/>
<div class="clear_button"><a href="{% url 'ippidb' %}?reset" class="clear_all">Clear all</a></div>
</div>
</div>
</div>
......
......@@ -4,7 +4,7 @@ from django.shortcuts import render
from django.http import HttpResponseRedirect, Http404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from formtools.wizard.views import SessionWizardView, NamedUrlSessionWizardView
from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ComplexCompositionForm, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, ProteinDomainComplexFormSet, PpiForm, PpiComplexForm, ProteinFormSet,TestsForm, CompoundForm, CompoundFormSet
from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ComplexCompositionForm, ComplexCompositionFormSet, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, PpiComplexForm, ProteinFormSet,TestsForm, CompoundForm, CompoundFormSet
from .models import Protein, Bibliography, ProteinDomainComplex, ProteinDomainBoundComplex, RefCompoundBiblio, TestActivityDescription, Compound, Ppi, Disease, Taxonomy
from .ws import get_pdb_uniprot_mapping
......@@ -59,7 +59,7 @@ FORMS = [("IdForm", ippidb.forms.IdForm),
("PDBForm", ippidb.forms.PDBForm),
("ProteinDomainComplexTypeForm",
ippidb.forms.ProteinDomainComplexTypeForm),
("ProteinDomainComplexForm", ippidb.forms.ComplexCompositionForm),
("ProteinDomainComplexForm", ippidb.forms.ComplexCompositionFormSet),
("PpiForm", ippidb.forms.PpiForm),
("CompoundForm", ippidb.forms.CompoundFormSet),
("TestsForm", ippidb.forms.TestsForm),]
......
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