コード例 #1
0
ファイル: rest.py プロジェクト: gr33nfury/cs3398Server
def get_appointment(session, currentUser, appointment_id):
	controller = AppointmentController(session)
	try:
		res = flask.jsonify(controller.get_appointment(appointment_id))
	except NoResultFound:
		res = flask.jsonify(status='error', errors=['could not find appointment'])
		res.status_code = 404
	return res
コード例 #2
0
def get_appointment(session, currentUser, appointment_id):
    controller = AppointmentController(session)
    try:
        res = flask.jsonify(controller.get_appointment(appointment_id))
    except NoResultFound:
        res = flask.jsonify(status='error',
                            errors=['could not find appointment'])
        res.status_code = 404
    return res
コード例 #3
0
ファイル: rest.py プロジェクト: gr33nfury/cs3398Server
def post_appointments(session, currentUser):
	controller = AppointmentController(session)
	data = flask.request.get_json()
	result = controller.post_appointment(data)
	return flask.jsonify(result)
コード例 #4
0
ファイル: rest.py プロジェクト: gr33nfury/cs3398Server
def get_appointments(session, currentUser):
	controller = AppointmentController(session)
	appointments = controller.get_appointments()
	return flask.jsonify({'appointments':appointments})
コード例 #5
0
def post_appointments(session, currentUser):
    controller = AppointmentController(session)
    data = flask.request.get_json()
    result = controller.post_appointment(data)
    return flask.jsonify(result)
コード例 #6
0
def get_appointments(session, currentUser):
    controller = AppointmentController(session)
    appointments = controller.get_appointments()
    return flask.jsonify({'appointments': appointments})