code: def add_template_for_node(name, node_id):
      "Set the template to use to display the node"
      with current_app.app_context():
          db.execute(text(fetch_query_string('insert_template.sql')),
                  name=name, node_id=node_id)
          result = db.execute(text(fetch_query_string('select_template.sql')),
                            name=name, node_id=node_id).fetchall()
          if result:
              template_id = result[0]['id']
              db.execute(text(fetch_query_string('update_template_node.sql')),
                      template=template_id, node_id=node_idf add_template_for_node(name, node_id):
      "Set the template to use to display the node"
      with current_app.app_context():
          db.execute(text(fetch_query_string('insert_template.sql')),
                  name=name, node_id=node_id)
          result = db.execute(text(fetch_query_string('select_template.sql')),
                            name=name, node_id=node_id).fetchall()
          if result:
              template_id = result[0]['id']
              db.execute(text(fetch_query_string('update_template_node.sql')),
                      template=template_id, node_id=node_id)
docs: Set the template to use to display the node