analytics/geckoboard_views.py
def geckoboard_rag_widget(request):
    """
    Searches the GET variables for metric UIDs, and displays
    them in a RAG widget.
    """

    params = get_gecko_params(request)
    print params['uids']
    max_date = datetime.now()-timedelta(days=params['days_back'])

    metrics = Metric.objects.filter(uid__in=params['uids'])
    results = [(metric.latest_count(frequency=params['frequency'], count=not params['cumulative'],
        cumulative=params['cumulative'], max_date=max_date), metric.title) for metric in metrics]
    
    return tuple(results)
def geckoboard_rag_widget(request):
    """
    Searches the GET variables for metric UIDs, and displays
    them in a RAG widget.
    """

    params = get_gecko_params(request)
    print params['uids']
    max_date = datetime.now()-timedelta(days=params['days_back'])

    metrics = Metric.objects.filter(uid__in=params['uids'])
    results = [(metric.latest_count(frequency=params['frequency'], count=not params['cumulative'],
        cumulative=params['cumulative'], max_date=max_date), metric.title) for metric in metrics]
    
    return tuple(results)
Searches the GET variables for metric UIDs, and displays
    them in a RAG widget.