Пример #1
0
def load(request, id):
    cursor = connection.cursor()
    sql = """
        select tp.name, tp.group, tp.gradation from task_content tc
        left join task_project tp
        on  tc.project = tp.name and tc.env = tp.gradation
        where tc.id = '%s'
        """ % id
    cursor.execute(sql)
    row = cursor.fetchone()

    project, group, percent = row[0], row[1], row[2]

    #print project, group, percent



    log_mongo = ""

    mongo_conn = Mongo(
        host = '127.0.0.1',
        database = 'log',
        table = 'log_'+id,
    )

    log_mongo = mongo_conn.find()

    contents = ""
    for row in log_mongo:
        contents += row['content']

    return render_to_response("log_view.html", {"config":config, "content":contents})
Пример #2
0
def load(request, id):
    cursor = connection.cursor()
    sql = """
        select tp.name, tp.group, tp.gradation from task_content tc
        left join task_project tp
        on  tc.project = tp.name and tc.env = tp.gradation
        where tc.id = '%s'
        """ % id
    cursor.execute(sql)
    row = cursor.fetchone()

    project, group, percent = row[0], row[1], row[2]

    #print project, group, percent

    log_mongo = ""

    mongo_conn = Mongo(
        host='127.0.0.1',
        database='log',
        table='log_' + id,
    )

    log_mongo = mongo_conn.find()

    contents = ""
    for row in log_mongo:
        contents += row['content']

    return render_to_response("log_view.html", {
        "config": config,
        "content": contents
    })
Пример #3
0
def list(request, id):
    result = ""

    id = int(id)

    mongo_conn = Mongo(
        host = '127.0.0.1',
        database = 'release',
        table = 'percent',
    )

    percent_result = mongo_conn.find(
        task_id = id
    )


    for row in percent_result:
        pass


    try:
        row
    except UnboundLocalError, e:
        return HttpResponse(result)