Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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