screens/views.py
def search(request):
    """
    used for UI autocomplete searches. Only used on the endpoint details page. 
    :param request:
    :return: dict containing label and value keys
    """
    logger.info("__ screens search __")

    term = request.GET["term"]
    screen_list = Screen.objects.filter(Q(name__contains=term) | Q(description__contains=term))
    results = []
    for screen in screen_list:
        r = dict()
        r["value"] = str(screen.id)
        r["label"] = screen.name + " " + screen.description
        results.append(r)

    return HttpResponse(json.dumps(results), content_type="application/json")

    used for UI autocomplete searches. Only used on the endpoint details page. 
    :param request:
    :return: dict containing label and value keys
    
used for UI autocomplete searches. Only used on the endpoint details page.
used for UI autocomplete searches . Only used on the endpoint details page .
def search(request):
    logger.info("__ screens search __")
    term = request.GET["term"]
    screen_list = Screen.objects.filter(Q(name__contains=term) | Q(description__contains=term))
    results = []
    for screen in screen_list:
        r = dict()
        r["value"] = str(screen.id)
        r["label"] = screen.name + " " + screen.description
        results.append(r)
    return HttpResponse(json.dumps(results), content_type="application/json")
def search ( request ) : logger . info ( "__ screens search __" ) term = request . GET [ "term" ] screen_list = Screen . objects . filter ( Q ( name__contains = term ) | Q ( description__contains = term ) ) results = [ ] for screen in screen_list : r = dict ( ) r [ "value" ] = str ( screen . id ) r [ "label" ] = screen . name + " " + screen . description results . append ( r ) return HttpResponse ( json . dumps ( results ) , content_type = "application/json" )
used for UI autocomplete searches.
used for UI autocomplete searches .
"""
    used for UI autocomplete searches. Only used on the endpoint details page. 
    :param request:
    :return: dict containing label and value keys
    """
dict containing label and value keys
dict containing label and value keys
request
None