def create_a_placeholder(section_id=1, template_id=1, full_name='[[BAR||BAZ]]', display_name='[[BAZ]]'): placeholder = TemplatePlaceholders(template_id=template_id, section_id=section_id) placeholder.full_name = full_name placeholder.display_name = display_name return placeholder
def create_placeholders(new_placeholders, template_id, section_id): for placeholder in new_placeholders: _placeholder = TemplatePlaceholders() var_type, var_name = parse_placeholder_text(placeholder) _placeholder.full_name = placeholder _placeholder.display_name = var_name _placeholder.template_id = template_id _placeholder.section_id = section_id _placeholder.type = VARIABLE_TYPE_MAPS[var_type] db.session.add(_placeholder) db.session.commit()
def create_a_placeholder(section_id=1, template_id=1, full_name='[[BAR||BAZ]]', display_name='[[BAZ]]'): placeholder = TemplatePlaceholders(template_id=template_id, section_id=section_id) placeholder.full_name=full_name placeholder.display_name=display_name return placeholder