def get_transaction(trans_id): # fetch transaction via id try: t = Transaction.get(trans_id) return jsonify(t.serialize()) except: abort(404)
def get_transactions(): try: return jsonify(transactions=[i.serialize() for i in Transaction.get()]) except: abort(404) pass