def update_relation(): data = request.json db = Database() relation_button = RelationButton() relation_button.add_relation(db, data['domain'], data['range'], data['relation']) return { 'output': relation_button.output_relation_plain(db), 'relations': relation_button.get_relations(db) }
def get_relations(): db = Database() relation_button = RelationButton() return {'relations': relation_button.get_relations(db)}