def get_queryset(self, **kwargs):
return self.model.objects.filter(is_on_map=True)
+
+ def get_context_data(self, **kwargs):
+ context = super(OrganizationListView, self).get_context_data(**kwargs)
+ context['organization_types'] = self.get_queryset().values_list('type__name', flat=True).order_by('type__name').distinct('type__name')
+ return context
<div class="row">
<div class="col-xs-12 col-md-10 col-md-push-1">
-
+ <!-- list organization types dynamically functions of activated organization -->
+ {{ organization_types }}
<div class="map" id="network-map" style="width: 100%; height: 550px;">
</div>
<div class="slider-network__slide-subtitle">
{{ organization.city }}, {{ organization.country.name }}
</div>
+ <div class="">
+ {{ organization.type }}
+ </div>
</li>
{% comment %}