Here's where I'm exposed as the fraud of a programmer I am.
I've never created a data tree.
Basically, I have a table with four fields: A, B, C, and D. I need to create a tree of unordered lists based on these fields. Ultimately, it would look something like this:
- A1
- B1
- C1
- D1
- D2
- C2
- D3
- D4
- C1
- B2
- C2
- D5
- D6
- C3
- D7
- D8
- C2
- B1
- A2
- B2
- C1
- D9
- D10
- C4
- D11
- D12
- C1
- B3
- C3
- D13
- D14
- C4
- D15
- D16
- C3
- B2
It's a pretty basic, 4-level tree...I think. It is much larger and complex than I'm representing here, but that's enough to get the point across.
I'm hoping to keep it to one database call, but I'm not sure if that's possible.
I'll be fetching the data with a Django QuerySet. I have Python at my disposal.
I don't even know where to start with the programming logic to keep it from becoming unwieldy.
I'd appreciate any pointers, guidance, links...just about anything!