(self, uid, rid, rdb)
This will delete a specified reaction
This will delete a specified reaction
This will delete a specified reaction
def deleteReaction(self, uid, rid, rdb):
        ''' This will delete a specified reaction '''
        reaction = r.table('reactions').get(rid).run(rdb)
        if reaction['uid'] == uid:
            delete = r.table('reactions').get(rid).delete().run(rdb)
            if delete['deleted'] == 1:
                qdata = {}
                qdata['item'] = reaction
                qdata['action'] = 'delete'
                qdata['type'] = 'reaction'
                qdata['item']['rid'] = rid
                q1 = r.table('dc1queue').insert(qdata).run(rdb)
                q2 = r.table('dc2queue').insert(qdata).run(rdb)
                return True
            else:
                return False
        else:
            return False
def deleteReaction ( self , uid , rid , rdb ) : reaction = r . table ( 'reactions' ) . get ( rid ) . run ( rdb ) if reaction [ 'uid' ] == uid : delete = r . table ( 'reactions' ) . get ( rid ) . delete ( ) . run ( rdb ) if delete [ 'deleted' ] == 1 : qdata = { } qdata [ 'item' ] = reaction qdata [ 'action' ] = 'delete' qdata [ 'type' ] = 'reaction' qdata [ 'item' ] [ 'rid' ] = rid q1 = r . table ( 'dc1queue' ) . insert ( qdata ) . run ( rdb ) q2 = r . table ( 'dc2queue' ) . insert ( qdata ) . run ( rdb ) return True else : return False else : return False