from db.response_option import ResponseOptionPool class ResponseOptionList: def __init__(self, cursor): self.cursor = cursor def render(self, question_id = None): rop = ResponseOptionPool(self.cursor) if question_id: rendered_response_options = [i.render_full() for i in rop.select_by_question_id(question_id)] else: rendered_response_options = [i.render_full() for i in rop.iter()] return "\n".join(rendered_response_options)