def collection_report(request, username, slug, report): c = get_collection(request, username, slug) stats_base_url = c.stats_url() view = get_report_view(request) return render(request, 'stats/reports/%s.html' % report, {'collection': c, 'search_cat': 'collections', 'report': report, 'view': view, 'username': username, 'slug': slug, 'stats_base_url': stats_base_url})
def collection_series(request, username, slug, format, group, start, end, field): """Pull a single field from the collection_query data""" start, end = get_daterange_or_404(start, end) group = "date" if group == "day" else group series = [] c = get_collection(request, username, slug) full_series = _collection_query(request, c, start, end) for row in full_series: if field in row["data"]: series.append({"date": row["date"], "count": row["data"][field]}) return render_json(request, None, series)
def collection_series(request, username, slug, format, group, start, end, field): """Pull a single field from the collection_query data""" start, end = get_daterange_or_404(start, end) group = 'date' if group == 'day' else group series = [] c = get_collection(request, username, slug) full_series = _collection_query(request, c, start, end) for row in full_series: if field in row['data']: series.append({ 'date': row['date'], 'count': row['data'][field], }) return render_json(request, None, series)
def collection_report(request, username, slug, report): c = get_collection(request, username, slug) stats_base_url = c.stats_url() view = get_report_view(request) return render( request, "stats/reports/%s.html" % report, { "collection": c, "search_cat": "collections", "report": report, "view": view, "username": username, "slug": slug, "stats_base_url": stats_base_url, }, )
def collection_stats(request, username, slug, group, start, end, format): c = get_collection(request, username, slug) start, end = get_daterange_or_404(start, end) return collection(request, c.uuid, format, start, end)