# Path: washmap/stats/models.py
# class StatDescription(Sortable):
#     class Meta(Sortable.Meta):
# class StatValue(models.Model):
#     class Meta:
#     def __unicode__(self):
#     def __unicode__(self):


from django.utils import simplejson
from collections import Counter
from django.db.models import Max, Min
from .models import StatValue, StatDescription, StatGroup
        stat_dictionary[d]["maxY"] = minmax['max']
        stat_dictionary[d]["hideGraph"] = hide_graph
    return stat_dictionary


def get_all_stats_for_one_country(country, visible=None):
    """
    Produce a dictionary of stat values given:
        * countries - the list of countries required
        * and visible flag
    """
    stats_groups, stats_descriptions, stats = \
        get_stats_groups_descriptions([country], visible)

    stat_dictionary = _build_stat_dictionary(stats_descriptions, stats)

    return (stats_groups, stats_descriptions, stat_dictionary)


def get_all_stats_for_one_country_one_group(country, group, visible=None):
    """
    Produce a dictionary of stat values given:
        * countries - the list of countries required
        * and visible flag
    """
    stats = StatValue.objects.filter(country=country)
    stats = stats.filter(description__group=group)
    if visible:
        stats = stats.filter(visible=visible)


# Path: washmap/stats/models.py
# class StatDescription(Sortable):
#     class Meta(Sortable.Meta):
# class StatValue(models.Model):
#     class Meta:
#     def __unicode__(self):
#     def __unicode__(self):


# Path: washmap/stats/utils.py
from django.utils import simplejson
from collections import Counter
from django.db.models import Max, Min
from .models import StatValue, StatDescription, StatGroup

        stat_dictionary[d]["maxY"] = minmax['max']
        stat_dictionary[d]["hideGraph"] = hide_graph
    return stat_dictionary


def get_all_stats_for_one_country(country, visible=None):
    """
    Produce a dictionary of stat values given:
        * countries - the list of countries required
        * and visible flag
    """
    stats_groups, stats_descriptions, stats = \
        get_stats_groups_descriptions([country], visible)

    stat_dictionary = _build_stat_dictionary(stats_descriptions, stats)

    return (stats_groups, stats_descriptions, stat_dictionary)


def get_all_stats_for_one_country_one_group(country, group, visible=None):
    """
    Produce a dictionary of stat values given:
        * countries - the list of countries required
        * and visible flag
    """
    stats = StatValue.objects.filter(country=country)
    stats = stats.filter(description__group=group)
    if visible:
        stats = stats.filter(visible=visible)


    stats_descriptions = StatDescription.objects.filter(