title: How to create an organizational chart from SQL database with flask?
body: <p>I have a SQL database like this:</p>
  <p><a href="https://i.stack.imgur.com/Ub4XC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ub4XC.png" alt="enter image description here" /></a></p>
  <p>Basically this is a hierarchical database where you have managers (parent) and employees (children).</p>
  <p>Currently I am working with flask which allows me to add/remove managers and employees and my idea is to have an html file which automatically reads from my SQL database and creates a tree like strucure (or an organizational chart) like this:</p>
  <p><a href="https://i.stack.imgur.com/yGoYJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yGoYJ.png" alt="enter image description here" /></a></p>
  <p>I have figured out a way to create nested unordered lists which can be then turned into the chart by using the following library: <a href="https://github.com/caprica/jquery-orgchart" rel="nofollow noreferrer">https://github.com/caprica/jquery-orgchart</a></p>
  <p>However this works basically only when the database is static and does not change over time. I saw some solutions where they use json files but I have no clue of the middle step that leads from the SQL database to the json file.</p>
  <p>Therefore, would you be able to propose an approach to solve this problem starting from the database? Which solution do you recommend? Are there any tutorials / examples that I could follow?</p>
  <p>Thanks in advance.</p>