diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html index 6b2cd4f7eaafae573ba773e9e030da77141104ae..b8c170530e465e6105d33b1742ce3a619abead6f 100644 --- a/ippisite/ippidb/templates/compound_list.html +++ b/ippisite/ippidb/templates/compound_list.html @@ -33,6 +33,7 @@ <main class="col-12" role="main"> <form> <div class="row"> + {% include "multiselection_button.html" with label="PPI Family" param_name="family" %} {% include "multiselection_button.html" with label="PPI" param_name="ppi" %} {% include "multiselection_button.html" with label="Disease" param_name="disease" %} {% include "multiselection_button.html" with label="Organism" param_name="taxonomy" %} @@ -128,6 +129,7 @@ </ul> </nav> + {% include "multiselection_modal.html" with label="PPI Family" selected_list=selected_families unselected_list=families param_name="family" all_param_name="families_all" all_param_value=families_all %} {% include "multiselection_modal.html" with label="PPI" selected_list=selected_ppis unselected_list=ppis param_name="ppi" all_param_name="ppis_all" all_param_value=ppis_all %} {% include "multiselection_modal.html" with label="Disease" selected_list=selected_diseases unselected_list=diseases param_name="disease" all_param_name="diseases_all" all_param_value=diseases_all %} {% include "multiselection_modal.html" with label="Organism" selected_list=selected_taxonomies unselected_list=taxonomies param_name="taxonomy" all_param_name="taxonomies_all" all_param_value=taxonomies_all %} diff --git a/ippisite/ippidb/views.py b/ippisite/ippidb/views.py index 0988d80c9e32ef1ff7a3bdd52dafd0bdf9c902cd..8835d1d83b77bc50ed223d338db8f1046ba6a242 100644 --- a/ippisite/ippidb/views.py +++ b/ippisite/ippidb/views.py @@ -7,7 +7,7 @@ from formtools.wizard.views import SessionWizardView, NamedUrlSessionWizardView import ippidb from .forms import IdForm, BibliographyForm, PDBForm, ProteinForm, ComplexCompositionForm, ComplexCompositionFormSet, ProteinDomainComplexTypeForm, ProteinDomainComplexForm, PpiForm, PpiComplexForm, PpiAndComplexForm, ProteinFormSet,TestsForm, CompoundForm, CompoundFormSet -from .models import Protein, Bibliography, ProteinDomainComplex, ProteinDomainBoundComplex, RefCompoundBiblio, TestActivityDescription, Compound, Ppi, Disease, Taxonomy, LeLleBiplotData, PcaBiplotData +from .models import Protein, Bibliography, ProteinDomainComplex, ProteinDomainBoundComplex, RefCompoundBiblio, TestActivityDescription, Compound, Ppi, Disease, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily from .ws import get_pdb_uniprot_mapping @@ -178,6 +178,8 @@ def compound_list(request): Display the list of compounds """ compounds = Compound.objects.order_by('id') + if request.GET.get('family'): + compounds = compounds.filter(compoundaction__ppi__family__id__in=request.GET.getlist('family')) # if filtering on "action on PPI" if request.GET.get('ppi'): compounds = compounds.filter(compoundaction__ppi__id__in=request.GET.getlist('ppi')) @@ -187,6 +189,8 @@ def compound_list(request): compounds = compounds.filter(compoundaction__ppi_id__ppicomplex__complex__protein__organism__id__in=request.GET.getlist('taxonomy')) if request.GET.get('boundcomplex'): compounds = compounds.filter(compoundaction__ppi_id__ppicomplex__complex__id__in=request.GET.getlist('boundcomplex')) + selected_families = PpiFamily.objects.filter(id__in=request.GET.getlist('family')) + families = PpiFamily.objects.exclude(id__in=request.GET.getlist('family')) selected_ppis = Ppi.objects.filter(id__in=request.GET.getlist('ppi')) ppis = Ppi.objects.exclude(id__in=request.GET.getlist('ppi')) selected_diseases = Disease.objects.filter(id__in=request.GET.getlist('disease')) @@ -221,6 +225,8 @@ def compound_list(request): 'count': count, 'selected_ppis': selected_ppis, 'ppis': ppis, + 'selected_families': selected_families, + 'families': families, 'selected_diseases': selected_diseases, 'diseases': diseases, 'selected_taxonomies': selected_taxonomies,