コード例 #1
0
def work_get_all():
    myDB = WEBDB(dbfile, {'logging': 'on', 'type': 'sqlite'})
    query = """
    SELECT id, name, content_id, createdate, lastdate, active
    FROM
    table_work
    """
    results = myDB.executeQueryDict(query)
    return json.dumps(results)
コード例 #2
0
ファイル: main.py プロジェクト: Mastakey/python-flask-wnd
def run_main():
    myDB = WEBDB(dbfile, {'logging': 'on', 'type': 'sqlite'})
    myQuery = """
    SELECT *
    FROM table_work
    """
    results = myDB.executeQueryDict(myQuery)
    return render_template('main.html',
                           title='My Title',
                           main='My Main',
                           results=results)
コード例 #3
0
ファイル: main.py プロジェクト: Mastakey/python-flask-wnd
def work_get_all():
    myDB = WEBDB(dbfile, {'logging': 'on', 'type': 'sqlite'})
    query = """
    SELECT name, content_id, createdate, lastdate, active
    FROM
    table_work
    """
    results = myDB.executeQueryDict(query)
    return render_template('main.html',
                           title='My Title',
                           main='My Main',
                           results=results)
コード例 #4
0
def work_get(id):
    myDB = WEBDB(dbfile, {'logging': 'on', 'type': 'sqlite'})
    workquery = """
    SELECT w.id, w.name, w.content_id, w.createdate, w.lastdate, w.active, c.content_blob
    FROM
    table_work w,
    table_content c
    WHERE
    w.content_id = c.id AND
    w.id = """ + str(id) + """
    """
    results = myDB.executeQueryDict(workquery)
    return json.dumps(results)