コード例 #1
0
ファイル: tables.py プロジェクト: occrp/ouija
def rows(table_name):
    table = db.get(table_name)
    if table is None:
        raise NotFound()
    authz.require(authz.table(table))
    q = OuijaQuery(db, {
        'columns': [{'table': table_name}]
    })
    return jsonify(Pager(q, table_name=table_name, _external=True))
コード例 #2
0
ファイル: tables.py プロジェクト: occrp/ouija
def view(table_name):
    table = db.get(table_name)
    if table is None:
        raise NotFound()
    authz.require(authz.table(table))
    return jsonify(table)
コード例 #3
0
ファイル: tables.py プロジェクト: occrp/ouija
def index():
    tables = [t for t in db.tables if authz.table(t)]
    return jsonify({
        'results': tables,
        'total': len(tables)
    })