Commit 7def6400 authored by fred's avatar fred

add french-speaking stats

parent 82cef872
......@@ -17,6 +17,7 @@
<li>Instru: {{zone.stats.instru}} ({{zone.stats.instru_percentage}})</li>
<li>SABAM: {{zone.stats.sabam}} ({{zone.stats.sabam_percentage}})</li>
<li>CFWB: {{zone.stats.cfwb}} ({{zone.stats.cfwb_percentage}})</li>
<li>French-speaking: {{zone.stats.french}} ({{zone.stats.french_percentage}})</li>
</ul></li>
</ul>
......
......@@ -91,6 +91,15 @@ class ZoneStats(object):
def cfwb_percentage(self):
return self.percentage(cfwb=True)
def french(self):
return self.count(language='fr')
def french_percentage(self):
considered_tracks = self.count() - self.instru()
if considered_tracks == 0:
return '-'
return str(100 * self.french() / considered_tracks)
class StatisticsView(TemplateView):
template_name = 'nonstop/statistics.html'
......
Markdown is supported
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