def render(string, context):
    jinja_environment = jinja2.Environment(undefined=jinja2.StrictUndefined)
    return jinja_environment.from_string(string).render(context)

template="""

class PentestDB:

{% for entity in conception %}
def upsert_{{entity.name}}():
    pass
{{entity.name}}
    {% for field in entity %}
    {{field.name}}
    {% endfor %}
{% endfor %}
"""

context = {"conception": conception}
print(render(template, context))
