def user_get(user_ID, dataType=None): if dataType: response = dynamoAccess.get_item(USER_TABLE, 'user_ID', user_ID, 'dataType', dataType) else: response = dynamoAccess.query(USER_TABLE, 'user_ID', user_ID) return response
def get_attraction(attraction_ID): response = dynamoAccess.get_item(ATTRACTION_TABLE, 'attraction_ID', attraction_ID) status = status_response() if response: status.attach_data('attraction', response, True) else: status.set_status(False) status.set_errorMessage('error get attraction from database') return status
def get_moment(attraction_ID, moment_ID): response = dynamoAccess.get_item(MOMENT_TABLE, 'attraction_ID', attraction_ID, 'moment_ID', moment_ID) status = status_response() if response: status.attach_data('moment', response, True) else: status.set_status(False) status.set_errorMessage('error get moment from database') return status
def lookup_username(username): response = dynamoAccess.get_item(EXP_ID_LOOKUP_TABLE, 'exp_ID', username) return response['user_ID']
def lookup_email(email): response = dynamoAccess.get_item(EMAIL_LOOKUP_TABLE, 'email', email) return response['user_ID']