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

Pass db object everywhere.

parent 0b6b6e63
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ def all_stats(db, geocacher_name):
res = {}
for plugin in STATS_PLUGINS:
res[plugin.__name__] = plugin(geocacher)
res[plugin.__name__] = plugin(db, geocacher)
return res
from .basic import *
from . import stats_plugin
def _field_count(geocacher, field):
def _field_count(db, geocacher, field):
res = {}
for cache in geocacher.found_geocaches:
......@@ -12,14 +12,14 @@ def _field_count(geocacher, field):
return res
@stats_plugin
def type_count(geocacher):
return _field_count(geocacher, 'type')
def type_count(db, geocacher):
return _field_count(db, geocacher, 'type')
@stats_plugin
def size_count(geocacher):
return _field_count(geocacher, 'size')
def size_count(db, geocacher):
return _field_count(db, geocacher, 'size')
@stats_plugin
def difficulty_count(geocacher):
return _field_count(geocacher, 'difficulty')
def difficulty_count(db, geocacher):
return _field_count(db, geocacher, 'difficulty')
@stats_plugin
def terrain_count(geocacher):
return _field_count(geocacher, 'terrain')
def terrain_count(db, geocacher):
return _field_count(db, geocacher, 'terrain')
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