Beispiel #1
0
def add_university():
    json = request.get_json()
    uni = json['uni']
    if University.get_uni(uni):
        return jsonify({"error": "University already exists"}), 201
    University.add_university(uni)
    return jsonify({"message": "OK"}), 201
Beispiel #2
0
def add_university():
    json = request.get_json()
    uni = json['uni']
    if University.get_uni(uni):
        return jsonify({"error": "University already exists"}), 201
    University.add_university(uni)
    return jsonify({"message": "OK"}), 201
Beispiel #3
0
def populate_colleges(university):
    university = University.get_uni(university)
    colleges = [college['name'] for college in university['colleges']]
    return jsonify({"colleges": colleges})
Beispiel #4
0
def populate_colleges(university):
    university = University.get_uni(university)
    colleges = [college['name'] for college in university['colleges']]
    return jsonify({"colleges": colleges})