Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 def delete(cls, id):
     status = r.table(cls._table).get(id).delete().run(conn)
     if status['errors']:
         raise DatabaseProcessError("Error deleting action")
     return True