'Get result of an existing query.
Parameters:
:query_id integer: ID of existing query'

@staticmethod
def get_query_result(query_id):

    try:
        query = models.Query.get_by_id(query_id)
    except models.NoResultFound:
        raise Exception(('Query    id    %s    does    not    exist.' % query_id))
    if (query.latest_query_data is None):
        raise Exception('Query    does    not    have    results    yet.')
    if (query.latest_query_data.data is None):
        raise Exception('Query    does    not    have    results    yet.')
    return json.loads(query.latest_query_data.data)
