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 active_epic_labels(project_id, cursor = None): cursor.execute(""" SELECT epic.id as epic_id, epic_card.name as epic_name, epic.background_color as epic_background_color, epic.foreground_color as epic_foreground_color from epic JOIN card AS epic_card ON epic_card.epic = epic.id WHERE epic_card.status <> 3 AND epic_card.type = 1 AND epic_card.project = %(project_id)s""", {'project_id' : project_id}) results = cursor.fetchall() labels = [] for row in results: labels.append(Epic.map_from_form(row)) return labels