示例#1
0
def get_month_stats():
    """Get month data to be rendered on charts.js"""

    map_categories = str(request.args.get("map_categories"))
    map_categories_list = map_categories.strip("]").strip("[").split(",")
    category_list = []

    for category in map_categories_list:
        category_stripped = category.strip('"')
        category_list.append(category_stripped)

    if map_categories != "None":

        return Crime_Stat.get_month_data_category(category_list)

    else:

        return Crime_Stat.get_month_data()