Skip to content
Snippets Groups Projects
Verified Commit c4f404e1 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add D/T matrix.

parent fba3b5c2
No related branches found
No related tags found
No related merge requests found
...@@ -23,3 +23,15 @@ def difficulty_count(db, geocacher): ...@@ -23,3 +23,15 @@ def difficulty_count(db, geocacher):
@stats_plugin @stats_plugin
def terrain_count(db, geocacher): def terrain_count(db, geocacher):
return _field_count(db, geocacher, 'terrain') return _field_count(db, geocacher, 'terrain')
@stats_plugin
def difficulty_terrain_count(db, geocacher):
res = {}
for cache in geocacher.found_geocaches:
combo = (cache.difficulty, cache.terrain)
if not combo in res:
res[combo] = 0
res[combo] += 1
return res
<table>
<tr>
<td></td>
{% for d in range(10, 55, 5) %}
<td>{{ d / 10 }}</td>
{% endfor %}
<td></td>
</tr>
{% for t in range(10, 55, 5) %}
<tr>
<td>{{ t / 10 }}</td>
{% for d in range(10, 55, 5) %}
<td>{{ data['difficulty_terrain_count'][(d / 10, t / 10)] }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
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