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