def get_all(): """ Get all peers unfiltered """ peers = PeerController.get_all() if not peers: return jsonify(error='No peers were found'), 500 ser_peers = [] for peer in peers: ser_peer = row2dict(peer) ser_peer['job'] = None if (peer.task): ser_peer['job'] = row2dict(peer.task.job) ser_peers.append(ser_peer) return jsonify(peers=ser_peers)
def get_all(): """ Get all peers unfiltered """ peers = PeerController.get_all() if not peers: return jsonify(error='No peers were found'), 500 ser_peers = [] for peer in peers: ser_peer = row2dict(peer) ser_peer['job'] = None if(peer.task): ser_peer['job'] = row2dict(peer.task.job) ser_peers.append(ser_peer) return jsonify(peers=ser_peers)
def get_all(): users = User.query.all() return ([utils.row2dict(u) for u in users])
def get(id): u = User.query.get(id) return (utils.row2dict(u))
def get_all(): posts = Post.query.all() return ([utils.row2dict(p) for p in posts])
def get(id): p = Post.query.get(id) return (utils.row2dict(p))