backend/model_api/views.py
def scores_all(request):
    """
    This endpoint will return a list of quarantine score data points
    for all areas in a given date. The query param contains "weeks" and
    "weeks" denote the number of weeks after 2020-3-11.
    """
    weeks = int(float(request.query_params.get("weeks")))
    score_start_date = QuarantineScoreDataPoint.objects.first().date
    date = score_start_date + timedelta(days=7*weeks)

    quarantine_scores = QuarantineScoreDataPoint.objects.filter(
        date=date
    )

    response = [{
        'area': {
            'country': d.area.country,
            'state': d.area.state,
            'iso_2': d.area.iso_2,
        },
        'value': d.val,
        'date': d.date,
        'conf': d.conf

    } for d in quarantine_scores]

    return Response(response)

    This endpoint will return a list of quarantine score data points
    for all areas in a given date. The query param contains "weeks" and
    "weeks" denote the number of weeks after 2020-3-11.
    
This endpoint will return a list of quarantine score data points
for all areas in a given date. The query param contains "weeks" and
"weeks" denote the number of weeks after 2020-3-11.
This endpoint will return a list of quarantine score data points for all areas in a given date . The query param contains " weeks " and " weeks " denote the number of weeks after 2020 - 3 - 11 .
def scores_all(request):
    weeks = int(float(request.query_params.get("weeks")))
    score_start_date = QuarantineScoreDataPoint.objects.first().date
    date = score_start_date + timedelta(days=7*weeks)
    quarantine_scores = QuarantineScoreDataPoint.objects.filter(
        date=date
    )
    response = [{
        'area': {
            'country': d.area.country,
            'state': d.area.state,
            'iso_2': d.area.iso_2,
        },
        'value': d.val,
        'date': d.date,
        'conf': d.conf
    } for d in quarantine_scores]
    return Response(response)
def scores_all ( request ) : weeks = int ( float ( request . query_params . get ( "weeks" ) ) ) score_start_date = QuarantineScoreDataPoint . objects . first ( ) . date date = score_start_date + timedelta ( days = 7 * weeks ) quarantine_scores = QuarantineScoreDataPoint . objects . filter ( date = date ) response = [ { 'area' : { 'country' : d . area . country , 'state' : d . area . state , 'iso_2' : d . area . iso_2 , } , 'value' : d . val , 'date' : d . date , 'conf' : d . conf } for d in quarantine_scores ] return Response ( response )
This endpoint will return a list of quarantine score data points
for all areas in a given date.
This endpoint will return a list of quarantine score data points for all areas in a given date .
"""
    This endpoint will return a list of quarantine score data points
    for all areas in a given date. The query param contains "weeks" and
    "weeks" denote the number of weeks after 2020-3-11.
    """
request