backend/model_api/views.py
def all_mrf_scores(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")))
    firstDate = MRFScoreDataPoint.objects.first().date
    date = firstDate + timedelta(days=7 * weeks)

    mrf_scores = MRFScoreDataPoint.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 mrf_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 all_mrf_scores(request):
    weeks = int(float(request.query_params.get("weeks")))
    firstDate = MRFScoreDataPoint.objects.first().date
    date = firstDate + timedelta(days=7 * weeks)
    mrf_scores = MRFScoreDataPoint.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 mrf_scores]
    return Response(response)
def all_mrf_scores ( request ) : weeks = int ( float ( request . query_params . get ( "weeks" ) ) ) firstDate = MRFScoreDataPoint . objects . first ( ) . date date = firstDate + timedelta ( days = 7 * weeks ) mrf_scores = MRFScoreDataPoint . 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 mrf_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