def create_or_update_fact(): librarian = Librarian.Instance() name = request.json['name'] body = request.json['body'] fact_type = request.json['fact_type'] metadata = request.json['metadata'] if request.json.has_key('fact_id') and request.json['fact_id']: fact_id = request.json['fact_id'] f = librarian.update(fact_id, name, fact_type, body, metadata) else: f = librarian.create(name, fact_type, body, metadata) return jsonify(resp=f)
def find_action(): librarian = Librarian.Instance() return jsonify(resp=librarian.get_by_type('fn'))
def get_all_facts(): librarian = Librarian.Instance() return jsonify(resp=librarian.get_all())