def extract_components(self, section): self.question = get_question_title(section) self.is_mandatory = is_mandatory(section) self.is_supplementary = is_supplementary(section) self.data_triggers = get_data_triggers(section) self.field_id = get_field_id(section) self.help_text = get_help_text(section) self.limits = get_limits(section)
def extract_content(self, section): content = get(section) result = { 'text': clean_text(content), } if self.is_text(): # Add extra required fields for the content: self.field_id = get_field_id(section) self.data_triggers = get_data_triggers(section) extra_attrs = get_text_attributes(content) result.update(extra_attrs) return result