def user(user_id): import UserManagement if request.json['achievement_id'] is not None: return UserManagement.add_achievement(request.json['achievement_id'], user_id) else: response.status = 400 return json.dumps(dict(status_code=400))
def sign_in(): """ {'user_id' = id : 'status_code' : 999 Email not found, 998 invalid pass, 200 sign in success} """ try: email = str(request.query['email']) password = str(request.query['password']) response.content_type = 'application/json' import UserManagement return UserManagement.sign_in(email, password) except BaseException, ex: logging.exception('Something Bad Happened - %s' % ex)
def sign_up(): """ @return a JSON object as follows: {'user_id' : id, 'status_code' : 200 sign_up success, 996 email already registered} """ try: email = request.json["email"] password = request.json["password"] response.content_type = 'application/json' import UserManagement return UserManagement.sign_up(email, password) except BaseException, ex: logging.exception('Something Bad Happened - %s' % ex)
def __init__(self): #change localhost to IP address and root to username of database #This was tested using wampserver self.Manager = UserManagement.UserManagement( ) #manager to communicate with the user table
def __init__(self): self.Manager = UserManagement.UserManagement( ) #manager for communication with the user table self.course_manager = CourseManagement( ) #manager for communication with the course table