Example #1
0
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))
Example #2
0
def view(table_name):
    table = db.get(table_name)
    if table is None:
        raise NotFound()
    authz.require(authz.table(table))
    return jsonify(table)
Example #3
0
def index():
    tables = [t for t in db.tables if authz.table(t)]
    return jsonify({
        'results': tables,
        'total': len(tables)
    })