def check_empty_dict ( GET_dict ) : empty = True for k , v in GET_dict . items ( ) : # Don't disable on p(age) or 'all' GET param if v and k != 'p' and k != 'all' : empty = False return empty
check if variable not passed into html python flask
Returns True if the GET querstring contains on values but it can contain empty keys . This is better than doing not bool ( request . GET ) as an empty key will return True
def check_empty_dict(GET_dict):
    """
    Returns True if the GET querstring contains on values, but it can contain
    empty keys.
    This is better than doing not bool(request.GET) as an empty key will return
    True
    """
    empty = True
    for k, v in GET_dict.items():
        # Don't disable on p(age) or 'all' GET param
        if v and k != 'p' and k != 'all':
            empty = False
    return empty