def delete_where(cls, predicate): status = r.table(cls._table).filter(predicate).delete().run(conn) if status['errors']: raise DatabaseProcessError("Could not complete the delete action") return True
def delete(cls, id): status = r.table(cls._table).get(id).delete().run(conn) if status['errors']: raise DatabaseProcessError("Could not complete the delete action") return True
def update_where(cls, predicate, fields): status = rdb.table( cls._table).filter(predicate).update(fields).run(conn) if status['errors']: raise DatabaseProcessError("Could not complete the update action") return True
def update(cls, id, fields): status = r.table(cls._table).get(id).update(fields).run(conn) if status['errors']: raise DatabaseProcessError("Could not complete the update action") return True
def delete(cls, id): status = r.table(cls._table).get(id).delete().run(conn) if status['errors']: raise DatabaseProcessError("Error deleting action") return True