def map_from_form(form): step = Step() step.id = int(form.get("step_id") or 0) step.task = form.get("step_task") step.assigned = User.map_from_form(form) step.status = step._get_status_from_form(form) return step
def map_from_form(form): card = Card() card.id = form.get('card_id') card.index = card._get_index_from_form(form) card.name = form.get('card_name') card.created = form.get('card_created') card.updated = form.get('card_updated') card.points = form.get('card_points') card.description = form.get('card_description') card.project = form.get('card_project') card.type = card._get_type_from_form(form) card.status = card._get_status_from_form(form) card.poc = User.map_from_form(form) #point of contact card.epic = Epic.map_from_form(form) return card
def get_project_users(project_id, cursor = None): cursor.execute(""" SELECT user.id as user_id, user.first_name as user_first_name, user.last_name as user_last_name FROM user WHERE user.id IN ( SELECT distinct user_id from user_projects where project_id = %(project_id)s );;""", {'project_id' : project_id}) results = cursor.fetchall() users = [] for row in results: users.append(User.map_from_form(row)) return users