I have 3 interdependent dropdowns in a django project, Level1, Level2 and Level3. These levels may increase. The mapping of these dropdowns is available in below format:
Table Name is LevelMapping

From the above mapping, I want to create a mapping as follows:
Team | Level1 | Level2 | Level3

How to get the mapping using recursion in python django?